You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, until keybindings only work for menu events: all other events will be considered successful and hence the remaining until cases will not be considered.
I can think of a number of events that should be considered to have failed at times: e.g. MoveToLineStart if the cursor is already at line start, CutSelection if nothing is selected, BackspaceWord if there is nothing to remove etc.
However, the only event I am personally interested in is CopySelection and CopySelectionSystem (which should reasonably fail if no text is currently selected), since being able to use until for those events would allow for e.g.
which in theory should emulate the behavior that many terminal emulators support as an option: Ctrl+c copies text if any text is selected, otherwise it interrupts / clears the line.
Sidenote
The line editor unselects the selected text when copyselectionsystem is activated, which seems a bit odd as I am not aware of any other text editor where that is the case.
At the moment of this writing, only the Menu events allow this type of layering. The other non menu event types will always return a success value, meaning that the until event will stop as soon as it reaches the command.
For the ctrl+c behavior, e.g. the Kitty terminal has the mappable actioncopy_or_interrupt, which the line editor expectedly does not respect since it always receives Ctrl+c from Kitty, as Kitty does not recognize the readline text as selected.
The text was updated successfully, but these errors were encountered:
Currently,
until
keybindings only work for menu events: all other events will be considered successful and hence the remaining until cases will not be considered.I can think of a number of events that should be considered to have failed at times: e.g.
MoveToLineStart
if the cursor is already at line start,CutSelection
if nothing is selected,BackspaceWord
if there is nothing to remove etc.However, the only event I am personally interested in is
CopySelection
andCopySelectionSystem
(which should reasonably fail if no text is currently selected), since being able to useuntil
for those events would allow for e.g.which in theory should emulate the behavior that many terminal emulators support as an option: Ctrl+c copies text if any text is selected, otherwise it interrupts / clears the line.
Sidenote
The line editor unselects the selected text when
copyselectionsystem
is activated, which seems a bit odd as I am not aware of any other text editor where that is the case.References
The nu documentation mentions that
For the ctrl+c behavior, e.g. the Kitty terminal has the mappable action
copy_or_interrupt
, which the line editor expectedly does not respect since it always receives Ctrl+c from Kitty, as Kitty does not recognize the readline text as selected.The text was updated successfully, but these errors were encountered: