tmux: Use shell script to complete selfinsert

Use a short shell script to complete the `selfinsert` keytable by
binding all keys that have a mapping in the root table.
This commit is contained in:
2022-09-08 18:34:18 +02:00
parent 515dbf1117
commit a1e431d3e1
2 changed files with 18 additions and 3 deletions

View File

@@ -97,9 +97,16 @@ bind -T resize 4 selectl main-vertical \; switchc -T resize
bind -T resize 5 selectl tiled \; switchc -T resize
bind r switchc -T resize
# Allow C-h to still be passed (when programs expect it as backspace, e.g. UEFI
# shell)
bind -r -T selfinsert C-h send C-h
# Create a key-table which self-inserts all keys that are bound in the root key
# table. (C-h for example is sometimes needed as backspace sequence)
#
# tmux_selfinsert.sh:
#
# tmux list-keys -T root | awk '{print $4}' | while read key; do
# tmux bind -r -T selfinsert "$key" send
# done
run-shell -b "$XDG_CONFIG_HOME/tmux/tmux_selfinsert.sh"
bind C-v switchc -T selfinsert
# Synchronize the panes in the current window with `<prefix>S`

View File

@@ -0,0 +1,8 @@
#!/bin/sh
#
# Create a key-table which self-inserts all keys that are bound in the root key
# table. (C-h for example is sometimes needed as backspace sequence)
tmux list-keys -T root | awk '{print $4}' | while read key; do
tmux bind -r -T selfinsert "$key" send
done