nix repl
has no way(?) to navigate by words #501
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#501
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When I press
<Ctrl-left>
or<Ctrl-right>
or<Alt-left>
or<Alt-right>
or various combinations of these,nix repl
does not navigate the prompt cursor by words.This makes me very sad and makes me press arrow keys way too many times. Is this
editline
's fault? Do we need to improve our bindings? Who knows.Since I happened to be digging into
editline
recently already I thought I'd try to add some context here (edit: and, forgot to mention, these keybinds do work in the Lix REPL for me):I think this is at least partially dependent on your terminal emulator, and what escape sequences it sends when you press those keys; for example this is a subset of mine:
Those correspond to
alt-b
Home
alt-f
End
respectively, AFAIK.
The output you wrote makes me think yours might be sending
\e[D
and\e[C
, for example, which don't have builtineditline
bindings, but there are a number of builtin ones for other escape sequences:ac81ca6d4b/src/editline.c (L1984-L1987)
It may be possible to add bindings with
el_bind_key_in_metamap
for the sequences your terminal emulator is sending too, but I'm not sure what they are normally supposed to translate to... From what I can find it seems like maybe that would normally just be the same as arrow keys?There is also a
CONFIG_ANSI_ARROWS
we might need to enable (but I think that must be enabled already, for normal arrow key functionality to work)....This issue was mentioned on Gerrit on the following CLs:
Fixed: https://gerrit.lix.systems/c/lix/+/1883
Upstream: https://github.com/troglobit/editline/pull/70