unable to use Ctrl+Left and Ctrl+Right to skip words when using tmux

Bug #945069 reported by Ionut Ticus
54
This bug affects 11 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Medium
Dustin Kirkland 

Bug Description

When using tmux as backend I'm unable to use the Control + Left and Control + Right combos to skip words.
I already tried to unbind the keys using the following options in .tmux.conf (located in ~/.config/byobu):
unbind-key -n C-Left
unbind-key -n C-Right
When using these options Ctrl + Left and Ctrl + Right skip only one character at a time (not a word).
byobu version is 5.0
tmux version is 1.6
Distro is ArchLinux 64bit, byobu was installed from AUR.

Revision history for this message
kbsali (kbsali) wrote :

"alt + left/right" does the job, but i'd would also prefer "ctrl + left/right" like in regular terminals.
Is that configurable somehow?

Thanks

$ byobu --version
byobu version 5.15
tmux 1.5

u 11.10

Revision history for this message
David Numan (dave-gv) wrote :

For those of us who use the command line a lot this is becoming frustrating. Does anyone know a work-around for this?

I'm on Ubuntu 12.04

Revision history for this message
Callum Macdonald (chmac) wrote :

Looks like on 12.04 tmux is the default backend. A little digging and it seems like the ctrl-left and ctrl-right keys are bound to resize the split screen on lines 42 and 43 of /usr/share/byobu/keybindings/f-keys.tmux. Commenting these out or adding matching unbind statements to ~/.byobu/keybindings seems to have some effect.

By default, on 12.04, my ctrl-left / ctrl-right does nothing if there is no split screen. If I unbind the as above, I can move one character at a time with ctrl-left / ctrl-right. I'm guessing there is some keybinding that could be mapped to restore the previous behaviour (of 11.10), but I'm not sure what. If anyone finds it, please post here.

I don't think this is a "bug" exactly, it seems to be a "feature", although I'd sure be happy to find a way of turning it off, driving me nuts.

Revision history for this message
Callum Macdonald (chmac) wrote :

For anyone else who finds this bug report seeking a workaround, changing ~/.byobu/backend to BYOBU_BACKEND=screen worked for me. I had to press ctrl-a and choose either screen or emacs mode for ctrl-right to work. Now I'm back to jumping words and I think my productivity just went up 15%. :-)

I'd still like to see a solution that works with tmux, because the single-line status bar is nice, and it sounds like tmux is the future for byobu.

Revision history for this message
Ionut Ticus (ticus-ionut) wrote :

I'm using the following settings to make byobu behave like I want it to:
 - in ~/.tmux.conf I have:
set-window-option -g xterm-keys on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'

- in ~/.config/byobu/keybindings.tmux I have:
unbind-key -n C-Left
unbind-key -n C-Right

IIRC the settings in ~/.tmux.conf allow me to use Shift+PgUp and Shift+PgDown to scroll back and forth in the terminal (I know there is a better combo (using Alt instead of Shift) that won't mix windows but I'm used to Shift and it works OK for me)) and the
settings in keybindings.tmux allow me to skip words using Ctrl + Left and Ctrl + Right.

byobu -> 5.17-1
tmux -> 1.6-2

Revision history for this message
Callum Macdonald (chmac) wrote :

@Ionut, thanks for posting back. Just the ~/.byobu/keybindings.tmux was not enough for me, I also had to add the first line ("set-window-option -g xterm-keys on") to my .tmux.conf which I actually found at ~/.byobu/.tmux.conf. With those two, byobu now works splendidly with the tmux backend.

I'd suggest we could close this ticket as it seems like it's more of a design change on behalf of the byobu author rather than a bug.

Revision history for this message
Ionut Ticus (ticus-ionut) wrote :

I've marked it as invalid because no other status seems adequate.

Changed in byobu:
status: New → Invalid
Revision history for this message
jakebiesinger (jake-biesinger) wrote :

Is this really the final solution? Invalid? This seems like a paper cut to me. Messing with default keybindings drives me nuts but being inconsistent about it is just terrible. The standard is Ctrl+Left and Ctrl-Right. Can we switch back to that? I think standard terminal movement trumps screen resizing.

tmux window resize uses Ctrl+Arrow now.
Alt+Up and Alt+Down are taken by switching windows in tmux (no effect in screen).
Shift+Alt+Arrow is the next option, except that Shit+Alt+Up is dedicated to desktop spread (same as Super+w)

What if we made the Alt+Arrow keys resize and use the Ctrl+Up and Ctrl+Down switch tmux windows? Works great for me...

See branch:
/+branch-id/31016

Revision history for this message
jakebiesinger (jake-biesinger) wrote :
Changed in byobu:
status: Invalid → In Progress
importance: Undecided → Medium
assignee: nobody → Dustin Kirkland (kirkland)
status: In Progress → Fix Committed
Revision history for this message
Jan Ernsting (jan.) wrote :

As jake-biesinger points out in #8 the change of tmux keybindings now conflicts with the Compiz Scale plugin, which is enabled by default and defaults Shift+Alt+Up to "Initiate Window Picker". I disabled the picker for now, but this could break the experience for new byobu users.

Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.