Slow response?

52 views
Skip to first unread message

Peng Yu

unread,
Jun 17, 2018, 10:00:48 AM6/17/18
to tmux-...@googlegroups.com
Hi,

I have the following line in my ~/.tmux.conf

bind-key -T root C-'[' next-window

When I type C-'[', it does not switch the window instantaneously.
There is a slight delay of say less than .5 sec. Is there any set up
in tmux that can make the switch instantaneously.


--
Regards,
Peng

Nicholas Marriott

unread,
Jun 18, 2018, 2:53:49 AM6/18/18
to Peng Yu, tmux-users
C-[ is Escape which is the start of almost every key escape sequence so tmux will always need to wait for escape-time to expire.

--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To post to this group, send email to tmux-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peng Yu

unread,
Jun 18, 2018, 12:39:18 PM6/18/18
to Nicholas Marriott, tmux-users
I don't see where `C-[` is defined. Could you please let me know? Thanks.

$ tmux -f /dev/null list-keys | grep C-
bind-key -T copy-mode C-Space send-keys -X begin-selection
bind-key -T copy-mode C-a send-keys -X start-of-line
bind-key -T copy-mode C-b send-keys -X cursor-left
bind-key -T copy-mode C-c send-keys -X cancel
bind-key -T copy-mode C-e send-keys -X end-of-line
bind-key -T copy-mode C-f send-keys -X cursor-right
bind-key -T copy-mode C-g send-keys -X clear-selection
bind-key -T copy-mode C-k send-keys -X copy-end-of-line
bind-key -T copy-mode C-n send-keys -X cursor-down
bind-key -T copy-mode C-p send-keys -X cursor-up
bind-key -T copy-mode C-r command-prompt -i -I
"#{pane_search_string}" -p "(search up)"

> C-[ is Escape which is the start of almost every key escape sequence so tmux
> will always need to wait for escape-time to expire.

--
Regards,
Peng

Nicholas Marriott

unread,
Jun 18, 2018, 12:43:01 PM6/18/18
to Peng Yu, tmux-users
It will appear as Escape because they are the same.

Micah Cowan

unread,
Jun 18, 2018, 12:59:57 PM6/18/18
to Nicholas Marriott, Peng Yu, tmux-users
Actually, the relevant ones in "root" table won't show up explicitly
anyway, probably.

Peng Yu, When Nicholas says C-[ is Escape, he means they're _exactly_
the same chracter as far as a terminal is concerned. It is also this
exact same character that starts off a number of other escape
sequences that are generated when you type, say, the left-arrow key,
or the end key, or the delete key. - so you wouldn't even find many of
the bindings for C-[ or Escape, because they're the built-in starts of
other "keys".

Earlier, Nicholas mentioned that this means tmux has to wait for
escape-time to elapse, which is your clue to fixing it: odds are
pretty good that you can do

set-option -s -g escape-time 0

to bring escape-time down to nothing. This may or may not have other
consequences for you (in some circumstances, a longer escape sequence
could be interpreted accidentally as pressing Escape separately,
followed by garbage characters), but in my experience with modern
terminal emulators, I don't think it has.

Keep in mind, though, that if you successfully bind C-[ in the root
table, you lose the ability to type the Escape character directly into
the terminal, which can be a handy thing. Because as Nicholas has
said, it is in fact the same character.

Note that ALL control characters correspond to other real "control"
characters in the Terminal. For instance, you'd typically also want to
be wary of binding things like C-i or C-m in the root table, because
they correspond to the Tab key or Carriage Return (what Enter usually
generates), and so you'd stop being able to type those. Other control
characters "happen" to be safe, like C-g, because usually the "bell"
character is output by software, and not input by a user. When in
doubt, bind to the prefix table unless you're certain it's safe for
root.

Hope that helps!
-mjc
Reply all
Reply to author
Forward
0 new messages