warpdotdev / warpdotdev/warp

Using vim keybindings to select from history will not enter insert mode

Open
#4,755 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:settings-keybindings bug ready-to-implement triaged
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
  1. Set up Warp with vim keybindings
  2. Esc and k to review command history. j and k to move through command history. Select a command from history using just j and k.
  3. Observe that h and l (and other movement keys like 0 and $ and b and w) move the cursor within the selected history item as expected.
  4. 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)
  5. Press a vim command key that would normally perform some kind of text editing and switch to insert mode. For example, dw to delete the current word, or R to enter replace mode, or D to delete the rest of the line and enter insert mode.
  6. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.