Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Added keybindings for Home and End keys. #62

Closed
wants to merge 1 commit into from

Conversation

xqwzts
Copy link

@xqwzts xqwzts commented Jun 8, 2013

No description provided.

@p-e-w
Copy link
Owner

p-e-w commented Jun 9, 2013

Thank you for your contribution. I am hesitant to add more keybindings though because there is a fundamental issue:

The xterm specification has multiple "keyboard modes" set using the DECSET control sequence (see http://invisible-island.net/xterm/ctlseqs/ctlseqs.html). The control sequence to be sent actually does not only depend on the key pressed but on the terminal's internal mode as well.

For example, while it is true that pressing Home should send \\033[1~ as in your commit "normally" (i.e. when application cursor mode is on), it should send \\033[H when cursor mode is off. I need to implement a mechanism that will allow us to specify which control sequence to send in which situation. This could be as simple as creating a new command ("SEND_CONTROL_SEQUENCE") with multiple parameters, one for each mode. Any input on how to achieve this is welcome.

@xqwzts
Copy link
Author

xqwzts commented Jul 22, 2013

@p-e-w : So I suppose the idea would be to implement the DECSET command by listening for CSI ? P m h - and keep a reference of the current DEC mode which gets checked when translating commands in SEND_CONTROL_SEQUENCE.

At which point we can implement most of the xterm commands as referenced in http://invisible-island.net/xterm/ctlseqs/ctlseqs.html

If that sounds right to you I'll jump into it, although I've never done any Vala tinkering before so if there are any obvious caveats I should be considering please do let me know.

@p-e-w
Copy link
Owner

p-e-w commented Jul 22, 2013

A very nice reference table for all the standard keybindings and the states which they are tied to can be found in the source of st: http://git.suckless.org/st/tree/config.def.h.

As for parsing the CSI sequence: Don't bother, that part is all done already (see https://github.com/p-e-w/finalterm/blob/master/src/TerminalStream.vala for the complex details). You can directly add DECSET handling to https://github.com/p-e-w/finalterm/blob/master/src/TerminalOutput.vala.

@p-e-w p-e-w mentioned this pull request Oct 21, 2013
@p-e-w
Copy link
Owner

p-e-w commented May 29, 2014

With 920f4b3, Final Term now has a full-fledged key bindings system, solving all of these problems and providing these and many other shortcuts.

@p-e-w p-e-w closed this May 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants