Using vim keybindings to select from history will not enter insert mode
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 65.1k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
Discord username (optional)
skaven81#83629#88993
Describe the bug
With Warp configured with vim keybindings, a common series of operations is to press Esc to enter command mode, then use the j and k keys to scroll back and forth in the command history. Warp supports this just fine. When a past command is selected, Warp appears to only allow i and a keys to exit command mode and enter insert mode (editing the command selected from the history). Using other text editing keys like D or R or r leaves the terminal in command mode and appear to be ignored. One must first press i or a, then Esc, then the "other" edit command like D or R or r.
To reproduce
- Set up Warp with vim keybindings
Escandkto review command history.jandkto move through command history. Select a command from history using justjandk.- Observe that
handl(and other movement keys like0and$andbandw) move the cursor within the selected history item as expected. - Place the cursor somewhere in the middle of the command (for example, at a command line option you would like to replace the value of)
- Press a vim command key that would normally perform some kind of text editing and switch to insert mode. For example,
dwto delete the current word, orRto enter replace mode, orDto delete the rest of the line and enter insert mode. - Observe that the command is ignored. The list of history commands remains on screen and the cursor remains a block (still in command mode).
Expected behavior
When selecting a command from history, vim keybindings should behave the same as they do when editing a normal command. Vim commands like dw or D or R or r -- and any other vim commands that perform some text editing and then drop into insert mode -- should be interpreted by the terminal as "I have selected this command from the history and would like to start editing it now".
Screenshots
No response
Operating system
Linux
Operating system and version
Ubuntu 22.04
Shell Version
bash 5.1.16
Current Warp version
v0.2024.04.09.08.01.stable_01
Regression
No, this bug or issue has existed throughout my experience using Warp
Recent working Warp date
n/a
Additional context
Using Wayland+gnome, standard config in Ubuntu 22.04
Does this block you from using Warp daily?
No
Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)
Yes, this I confirmed this only happens in Warp, not other terminals.
Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e
None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source files, tests, or entry points. First reproduce the vim-keybinding history-selection sequence described above, then trace the handling of editing commands such as dw, D, R, and r; done means those commands edit the selected history entry and enter the expected mode without the extra i or a step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100