Micro: Urxvt + zsh + micro keybindings

Created on 17 Jun 2017  路  6Comments  路  Source: zyedidia/micro

Some keybindings doesn't work: wordjumping, move lines, etc.
Commit hash: be81241
OS: Antergos Linux
Terminal: urxvt + zsh

tcell issue

Most helpful comment

Okay, I found a workaround:

1) make urxvt send xterm escape sequences (~/.Xresources):

!Xterm escapes, word by word movement
URxvt.keysym.Control-Left:    \033[1;5D
URxvt.keysym.Shift-Control-Left:    \033[1;6D
URxvt.keysym.Control-Right:    \033[1;5C
URxvt.keysym.Shift-Control-Right:    \033[1;6C
URxvt.keysym.Control-Up:    \033[1;5A
URxvt.keysym.Shift-Control-Up:    \033[1;6A
URxvt.keysym.Control-Down:    \033[1;5B
URxvt.keysym.Shift-Control-Down:    \033[1;6B

2) Bind the raw escape codes like you need to do for tmux ~/.config/micro/bindings.json):

    "\u001b[1;2A": "SelectUp",
    "\u001b[1;2B": "SelectDown",
    "\u001b[1;2C": "SelectRight",
    "\u001b[1;2D": "SelectLeft",
    "\u001b[1;5D": "WordLeft",
    "\u001b[1;5C": "WordRight",
    "\u001b[1;3A": "MoveLinesUp",
    "\u001b[1;3B": "MoveLinesDown",
    "\u001b[1;6C": "SelectWordRight",
    "\u001b[1;6D": "SelectWordLeft",
    "\u001b[1;3D": "StartOfLine",
    "\u001b[1;3C": "EndOfLine",
    "\u001b[1;4D": "SelectToStartOfLine",
    "\u001b[1;4C": "SelectToEndOfLine",
    "\u001b[1;5A": "ParagraphPrevious",
    "\u001b[1;5B": "ParagraphNext",
    "\u001b[1;6A": "SelectToStart",
    "\u001b[1;6B": "SelectToEnd",

I imagine that the issue is the same as with tmux, urxvt terminfo does not report correctly what it does on these keypresses.

All 6 comments

I can confirm the issue with latest git version. Is there a workaround for this?

Testing with raw mode indicates that urxvt sends the same escape sequences as st and xterm, where these bindings work.

Okay, I found a workaround:

1) make urxvt send xterm escape sequences (~/.Xresources):

!Xterm escapes, word by word movement
URxvt.keysym.Control-Left:    \033[1;5D
URxvt.keysym.Shift-Control-Left:    \033[1;6D
URxvt.keysym.Control-Right:    \033[1;5C
URxvt.keysym.Shift-Control-Right:    \033[1;6C
URxvt.keysym.Control-Up:    \033[1;5A
URxvt.keysym.Shift-Control-Up:    \033[1;6A
URxvt.keysym.Control-Down:    \033[1;5B
URxvt.keysym.Shift-Control-Down:    \033[1;6B

2) Bind the raw escape codes like you need to do for tmux ~/.config/micro/bindings.json):

    "\u001b[1;2A": "SelectUp",
    "\u001b[1;2B": "SelectDown",
    "\u001b[1;2C": "SelectRight",
    "\u001b[1;2D": "SelectLeft",
    "\u001b[1;5D": "WordLeft",
    "\u001b[1;5C": "WordRight",
    "\u001b[1;3A": "MoveLinesUp",
    "\u001b[1;3B": "MoveLinesDown",
    "\u001b[1;6C": "SelectWordRight",
    "\u001b[1;6D": "SelectWordLeft",
    "\u001b[1;3D": "StartOfLine",
    "\u001b[1;3C": "EndOfLine",
    "\u001b[1;4D": "SelectToStartOfLine",
    "\u001b[1;4C": "SelectToEndOfLine",
    "\u001b[1;5A": "ParagraphPrevious",
    "\u001b[1;5B": "ParagraphNext",
    "\u001b[1;6A": "SelectToStart",
    "\u001b[1;6B": "SelectToEnd",

I imagine that the issue is the same as with tmux, urxvt terminfo does not report correctly what it does on these keypresses.

@Chrysostomus the workaround works for me! Thanks you.

I have this issue with xfce-terminal and tmux. How to fix that with apps?

Research. Use the raw mode and cat to see what escape sequences micro receives. You can then bind them to desired actions.

There might be some other way too for some terminals, but this is one way.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rbagman picture Rbagman  路  4Comments

luis-lavaire picture luis-lavaire  路  3Comments

AndreyTheHacker picture AndreyTheHacker  路  3Comments

utkarsh2102 picture utkarsh2102  路  3Comments

bitcoinmeetups picture bitcoinmeetups  路  3Comments