Talk:Terminal control/Positional read: Difference between revisions

Content added Content deleted
Line 36: Line 36:


: I was thinking about doing such things, but it requires the terminal to be under the complete control of the program; basically, the task as it stands requires a model of operation that is actually quite rare. –[[User:Dkf|Donal Fellows]] 14:49, 3 December 2010 (UTC)
: I was thinking about doing such things, but it requires the terminal to be under the complete control of the program; basically, the task as it stands requires a model of operation that is actually quite rare. –[[User:Dkf|Donal Fellows]] 14:49, 3 December 2010 (UTC)

== Possible with tmux? ==

This task might become possible if the Unix terminal is a [http://tmux.sourceforge.net/ tmux] pane. Inside the pane, run these three shell commands:

<lang bash>$ tmux capture-pane
$ tmux show-buffer > my-file
$ tmux delete-buffer</lang>

Then one must find column 3, row 6 of ''my-file''. This is not trivial, because each line ends with ASCII NL, and some lines might end early.

I have not found any way to synchronize this operation if multiple processes (perhaps in different tmux panes) want to read characters at the same time. --[[User:Kernigh|Kernigh]] 19:48, 22 September 2011 (UTC)