floating or popup panes

21 views
Skip to first unread message

Sivaram Neelakantan

unread,
Sep 18, 2020, 12:05:54 PM9/18/20
to tmux-...@googlegroups.com
Not sure whether tmux users are aware, in the 3.2-rc release, you
could do something like this into your .tmux.conf

--8<---------------cut here---------------start------------->8---
bind-key -N "Toggle persistent popup shell" \
-n F4 if-shell -F '#{==:#{session_name},float}' { detach-client } \
{ popup -w70% -h70% -K -E -R \
'tmux attach -t float || tmux new -s float \; \
display-message "Press PF4 to toggle floating popup or Ctrl-D to kill it"'\
}
# from user comments from
# https://old.reddit.com/r/tmux/comments/itonec/floating_scratch_terminal_in_tmux/g5jxke4/

--8<---------------cut here---------------end--------------->8---

So pressing F4 will give you a popup pane that you can move with your
mouse. The 70% is for the window size you want in the popup. The
keyword to look in the manpage is 'popup'. And the -N adds a line to
the help when called via <prefix> ? key chord.

Other similar stuff without the fancy panes movement stuff

--8<---------------cut here---------------start------------->8---
# F1 for help
bind-key -N "Display man page for prompted topic" \
F1 command-prompt -p "Enter man topic:" "split-window 'exec man %%';resize-pane -Z"
# bind C-e to run run-shell; using Emacs lispy C-x C-e equivalent
bind-key -N "Execute prompted script/command;quote entire string if passing parameters" \
C-e command-prompt -p "Enter script to run:" "run-shell %%;\
display-message 'Quote entire string if passing parameters'"
--8<---------------cut here---------------end--------------->8---

Hope this is useful. If there are similar or simpler ways to do this,
do post them in this thread.

sivaram
--

Reply all
Reply to author
Forward
0 new messages