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

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

9999years
Copy link
Contributor

@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

Verified

This commit was signed with the committer’s verified signature.
9999years Rebecca Turner
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.
@9999years 9999years force-pushed the recognize-meta-arrows branch from 9fedc90 to d0f2a5b Compare September 9, 2024 02:32
@lf-
Copy link

lf- commented Sep 9, 2024

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

Verified

This commit was signed with the committer’s verified signature.
9999years Rebecca Turner
lf- pushed a commit to lix-project/lix that referenced this pull request Sep 11, 2024

Verified

This commit was signed with the committer’s verified signature.
9999years Rebecca Turner
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

Verified

This commit was signed with the committer’s verified signature.
9999years Rebecca Turner
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

Verified

This commit was signed with the committer’s verified signature.
9999years Rebecca Turner
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
Contributor 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.

@troglobit troglobit merged commit fb4d726 into troglobit:master Dec 7, 2024
@troglobit
Copy link
Owner

There, merged! Sorry for taking so long.

9999years added a commit to 9999years/nixpkgs that referenced this pull request Mar 20, 2025

Verified

This commit was signed with the committer’s verified signature.
9999years Rebecca Turner
This applies a merged but not released patch from upstream (`editline`
has not cut a release since 2020).

See: troglobit/editline#70
See: NixOS#341131
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.

None yet

4 participants