nix repl
has no way(?) to navigate by words #501
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
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…
Add table
Add a link
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