J'écris certaines fonctions dans .bashrc
pour rendre tmux
facile à utiliser:
#!/bin/bash # .bashrc # vim tmux #----- -------------------- tabc() { tmux kill-window; } tabe() { tmux new-window; } tabf() { tmux find-window $@; } tabn() { tmux next-window; } tabo() { ; } # <-- How to `tabonly`? tabp() { tmux previous-window; } qa() { tmux kill-session; } sp() { tmux split-window; } vsp() { tmux split-window -h; } on() { tmux kill-pane -a; } typeset -fx tab{c,e,f,n,o,p} {,v}sp qa on
Je veux mettre en œuvre la commande tabonly
, mais je ne sais pas comment.
Avec la fenêtre que vous souhaitez conserver en tant que fenêtre actuelle, appelez à next-window
et la next-window
kill-window
répétée, jusqu'à ce que next-window
échoue:
while tmux next-window 2> /dev/null; do tmux kill-window done
Pour une copie facile, tmux> = 1.7:
tabo() { tmux kill-window -a; }
Merci Chris Johnsen.