Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize Meta+Left and Meta+Right for word navigation #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

9999years
Copy link

@9999years 9999years commented Sep 8, 2024

I'm not sure exactly where to find canonical documentation for these codes, but this seems to match what my terminal produces (macOS + iTerm2+ Fish + Tmux).

It might also be nice to have some more support for editing the bindings for these characters; sequences of more than one character are not supported by el_bind_key and similar.

See: https://git.lix.systems/lix-project/lix/issues/501

@9999years 9999years marked this pull request as ready for review September 8, 2024 23:00
src/editline.c Outdated Show resolved Hide resolved
I'm not sure exactly where to find canonical documentation for these
codes, but this seems to match what my terminal produces (macOS + iTerm2
+ Fish + Tmux).

It might also be nice to have some more support for editing the bindings
for these characters; sequences of more than one character are not
supported by `el_bind_key` and similar.
@lf-
Copy link

lf- commented Sep 9, 2024

If you are looking for a reference for terminal codes, see: https://terminalguide.namepad.de/

lf- pushed a commit to lix-project/lix that referenced this pull request Sep 11, 2024
This applies troglobit/editline#70 to our build
of editline, which translates `meta-left` and `meta-right` into
`fd_word` and `bk_word`. This makes `nix repl` soooo much nicer to use!

Note: My terminal renders `meta-left` as `\e\e[C` and `meta-right` as
`\e\e[D`.

Closes https://git.lix.systems/lix-project/lix/issues/501

Change-Id: I048b10cf17231bbf4e6bf38e1d1d8572cedaa194
9999years added a commit to 9999years/nixpkgs that referenced this pull request Sep 11, 2024
Lix has applied this patch upstream in order to recognize `Alt+Left` and
`Alt+Right` for word navigation in `nix repl` on more terminals.
If this is merged into `editline` upstream I'll update `editline` in
Nixpkgs and then we can drop this patch.

See: troglobit/editline#70
See: https://gerrit.lix.systems/c/lix/+/1883
9999years added a commit to 9999years/nixpkgs that referenced this pull request Sep 11, 2024
Lix has applied this patch upstream in order to recognize `Alt+Left` and
`Alt+Right` for word navigation in `nix repl` on more terminals.
If this is merged into `editline` upstream I'll update `editline` in
Nixpkgs and then we can drop this patch.

See: troglobit/editline#70
See: https://gerrit.lix.systems/c/lix/+/1883
9999years added a commit to 9999years/nixpkgs that referenced this pull request Sep 11, 2024
Lix has applied this patch upstream in order to recognize `Alt+Left` and
`Alt+Right` for word navigation in `nix repl` on more terminals.
If this is merged into `editline` upstream I'll update `editline` in
Nixpkgs and then we can drop this patch.

See: troglobit/editline#70
See: https://gerrit.lix.systems/c/lix/+/1883
lf- pushed a commit to lix-project/lix that referenced this pull request Sep 11, 2024
This vendors the patch added in cl/1883 to avoid GitHub
garbage-collecting the commits we're referring to.

As @emilazy pointed out on GitHub:

> GitHub can garbage‐collect unmerged PR commits if they are later
> force‐pushed, which means that code review in upstreams can cause
> Nixpkgs builds to fail to reproduce in future.

See: NixOS/nixpkgs#341131 (comment)
See: troglobit/editline#70
See: https://gerrit.lix.systems/c/lix/+/1883

Change-Id: Ifff522f7f23310d6dbe9efc72fd40be5500ae872
@9999years
Copy link
Author

@troglobit Still looking for a review on this, thanks!

@troglobit
Copy link
Owner

I'll try to make some time this coming weekend, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants