Scripting tmux
arp242.net
Scripting tmux
1–10 of 20 posts
Re: Scripting tmux
#2Re: Scripting tmux
#3In the backend, it's all tmux CLI commands.
tmuxp (https://tmuxp.git-pull.com), similar to tmuxinator, uses libtmux under the hood to build workspaces from a yaml/json file: https://github.com/tmux-python/tmuxp/blob/master/tmuxp/works...
Despite that, I've found some people prefer just using plain tmux scripting (https://twitter.com/bitprophet/status/561356905843392514). Aside: That's Jeff Forcier, creator of fabric (http://www.fabfile.org/)
Through tmux's formats (http://man7.org/linux/man-pages/man1/tmux.1.html#FORMATS), you can about any info you'd like on your workspace.
An area I don't know about is -C (control mode). libtmux could technically use it to get live updates rather than inefficiently and possibly needlessly querying session/window/pane info to keep objects up to date. Apparently iterm2's tmux integration uses it.
Re: Scripting tmux
#4Re: Scripting tmux
#5I wrote libtmux ( https://libtmux.git-pull.com ) as a way to control tmux via python objects. In the backend, it's all tmux CLI commands. tmuxp ( https://tmuxp.git-pull.com ), similar to tmuxinator, uses libtmux under the hood to build workspaces from a yaml/json file: https://github.com/tmux-python/tmuxp/blob/master/tmuxp/works... Despite that, I've found some people prefer just using plain tmux scripting ( https://…
Re: Scripting tmux
#6which-key on vim has been great in making sure, I use new features, I add to my config file.
Re: Scripting tmux
#7 set -x
send(){ tmux send "$@";}
send 'links -no-connect https://news.ycombinator.com/login?goto=news' ;
send c-m; sleep 2;
send 3xblah c-m $HNPASSWORD c-m c-m c-m; sleep 2;
send Escape; sleep 1; send V S; sleep 1;
send 'scripting tmux' c-m Down Down Down Down Down Down c-m;
send Escape; sleep 1; send V S; sleep 1;
send 'add comment' c-m Up;
send 'This comment was posted using tmux scripting, as follows: ' c-m;
a=$(sed '5,18!d' $0); sleep 2;
send "$a"; sleep 2; send c-m c-m Down c-m;Re: Scripting tmux
#8Have been looking for a while, but does anyone know if there is there anything like which-key for tmux? which-key on vim has been great in making sure, I use new features, I add to my config file.
Not utterly comfortable, but helps most of the time.
Re: Scripting tmux
#9Anyone know of this or a better approach?
Re: Scripting tmux
#10This comment was posted using tmux scripting, as follows: set -x send(){ tmux send "$@";} send 'links -no-connect https://news.ycombinator.com/login?goto=news' ; send c-m; sleep 2; send 3xblah c-m $HNPASSWORD c-m c-m c-m; sleep 2; send Escape; sleep 1; send V S; sleep 1; send 'scripting tmux' c-m Down Down Down Down Down Down c-m; send Escape; sleep 1; send V S; sleep 1; send 'add comment' c-m Up; send 'This comment…