I've used iterm2 for a while (I love it!) and I'm just trying out
tmux. I get the following strange behaviour from iterm:
I have only one profile defined in iterm2. I've set things up to work
with the gnu readline library and emacs (i.e., i've configured in my
iterm2 profile the character sequences that are sent by iterm2 and
recognized by readline and emacs). But when I start tmux on a remote
server, iterm2 suddenly changes the character sequences that are being
sent. They no longer correspond to my iterm2 profile.
For example, in my iterm2 profile Ctrl-left arrow sends the sequence
^[[1;5D. In my ~/.inputrc file I have the line '"\e[1;5D":
backward-word'. If I do ctrl-v followed by ctrl-left arrow, I get
exactly the output I expect, namely "^[[1;5D". BUT after starting
tmux, ctrl-left arrow no longer works (i.e., it does not result in
backward-word). ctrl-v ctrl-left arrow shows that the character
sequence being sent is "^[OD". How come?
On Tue, Oct 30, 2012 at 8:05 PM, Ali Tofigh <alix.tof...@gmail.com> wrote:
[ ... ]
> when I start tmux on a remote
> server, iterm2 suddenly changes the character sequences that are being
> sent. They no longer correspond to my iterm2 profile.
I'm more familiar with screen than tmux, but I think they both work the
same way: screen/tmux will read the escape sequences from iterm2, then
re-encode them before sending them on to the programs running inside. So
the keys are probably making it from iterm2 to tmux correctly, but then
tmux is sending different keys to its terminals. Your next step might be
to take a close look at your tmux configuration.
For others who might be in similar situation: I'm trying to get emacs
to work properly inside tmux. By putting this line in the tmux
configuration file
set-window-option -g xterm-keys on
tmux will generate xterm sequences. My next step is to figure out how
to get emacs to understand the xterm sequences even when TERM=screen.
<sgiff...@suspectclass.com> wrote:
> On Tue, Oct 30, 2012 at 8:05 PM, Ali Tofigh <alix.tof...@gmail.com> wrote:
> [ ... ]
>> when I start tmux on a remote
>> server, iterm2 suddenly changes the character sequences that are being
>> sent. They no longer correspond to my iterm2 profile.
> I'm more familiar with screen than tmux, but I think they both work the same
> way: screen/tmux will read the escape sequences from iterm2, then re-encode
> them before sending them on to the programs running inside. So the keys are
> probably making it from iterm2 to tmux correctly, but then tmux is sending
> different keys to its terminals. Your next step might be to take a close
> look at your tmux configuration.
It's just that tmux man page explicitly says that TERM must be set to
screen or derivatives (like screen-256color) for programs running in a tmux
session.
/Ali
On 2012-10-31, at 23:37, Scott Gifford <sgiff...@suspectclass.com> wrote:
On Wed, Oct 31, 2012 at 5:02 PM, Ali Tofigh <alix.tof...@gmail.com> wrote:
[ ... ]
> My next step is to figure out how
> to get emacs to understand the xterm sequences even when TERM=screen.