0
votes

I want to bind Escape key to copy-mode, so I add this to the tmux conf file:

bind Escape copy-mode

but it doesn't work, unless I unbind the [ key first:

unbind [

bind Escape copy-mode

this works. But why? Why I can't leave Prefix+[ as another way to enter copy mode?

Thanks.

1
I just tried this and by just entering tmux bind Escape copy-mode via the command line both keybindings now work for entering copy mode.user777337
What version of tmux are you using?chepner

1 Answers

1
votes

In my limited opinion and knowledge, this is more so to resolve any potential conflicts with terminals. As described in the Terminal Type Descriptions Source File (termcap), Escape is defined as ^[ ( Ctrl-[ ). So it could be interpreted as ^[-[. The keys Escape and [ are also used in combination as well.

Excerpts from termcap:

In Cursor Mode, the cursor keys transmit "Esc [ {code}" sequences, conforming to ANSI standards.

...

Control Sequence Introducer is the two characters "Escape ["

I will gladly take any corrections, as this will help not only me, but also any other curious passerby's in the future.

P.S.: Those excerpts were taken from my OpenBSD 5.9 /usr/share/misc/termcap file.