0

For some unknown reason in Tmux the 'Tab' key clears the pane I'm in, which is annoying when I use 'Tab' to indent in Neovim and 'Shift Tab' to unindent.

Is there a way to fix this (stop 'Tab' clearing my panes and work as intended)

I've tested this in the default Mac terminal and iterm2, and it happens in both.

Outside of Tmux the 'Tab' key works fine in both terminals, indenting 4 or so spaces.

Also, I have C-i mapped to clear a pane usually.

Here is my .tmux.conf for reference:

set -g default-terminal 'screen-256color'

set -g prefix C-a
unbind C-b
bind-key C-a send-prefix


unbind %
bind | split-window -h

unbind '"'
bind - split-window -v

unbind r
bind r source-file ~/.tmux.conf

bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind -r h resize pane -L 5

bind -r m resize-pane -Z

set -g mouse on

set-window-option -g mode-keys vi

bind-key -T copy-mode-vi 'v' send -X begin-selection 
bind-key -T copy-mode-vi 'y' send -X copy-selection

unbind -T copy-mode-vi MouseDragEnd1Pane

bind C-i send-keys -R \; send-keys C-l \; clear-history

set -sg escape-time 10

set -g @plugin 'tmux-plugins/tpm'

set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'jimeh/tmux-themepack'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

set-g @thempack 'powerline/default/cyan'

set -g resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'

run '~/.tmux/plugins/tpm/tpm'

arkosno
  • 51
  • 5
  • what platform can I use to add a link to the recording? – arkosno Apr 22 '23 at 10:09
  • 2
    SO is a programming Q&A platform and this question is not about programming. Questions about operating systems, their utilities, networking and hardware, are off topic here. [What topics can I ask about here?](https://stackoverflow.com/help/on-topic). Please delete this and ask, instead, on https://superuser.com/ – Rob Apr 22 '23 at 15:05
  • My dearest apologies Mr Rob. – arkosno Apr 22 '23 at 16:56

2 Answers2

1

For most terminal apps Tab and Ctrl-i are the same. They both get the char with ASCII code 0x09.

Similar examples include:

  • EnterCtrl-M
  • EscCtrl-[
  • BackspaceCtrl-H

See this Wikipedia page for more details.

pynexj
  • 19,215
  • 5
  • 38
  • 56
0

Yes, Ctrl-i and Tab have the same ASCII code 0x09.

I thought just commenting on the C-i binding would work, but I had to unbind C-i in the .tmux.conf.

# bind -n C-i send-keys -R \; send-keys C-l \; clear-history
  unbind -n C-i

did the trick

arkosno
  • 51
  • 5
  • did you restart the tmux server (e.g. by terminating all sessions) after updating the tmux conf? otherwise the `c-i` binding is still in memory. simply reloading tmux conf does not work because it does not reset all settings before loading tmux conf. i usually run a manual `unbind` for this scenario without restarting whole tmux. – pynexj Apr 23 '23 at 01:22