Terminal Vim opens files in REPLACE mode by default #10606

Open
opened 2026-01-31 02:25:36 +00:00 by claunia · 0 comments
Owner

Originally created by @nickjj on GitHub (Sep 12, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.508]
Windows Terminal version (if applicable): Windows Terminal Preview / Version: 1.3.2382.0

It's also worth pointing out the problem exists with the regular stable release of Windows Terminal too.

Steps to reproduce

  1. Within Ubuntu 20.04 LTS WSL 2 install Vim with sudo apt-get update && sudo apt-get install vim-gtk
  2. touch test.txt
  3. vim test.txt
  4. Notice that you're in REPLACE mode instead of NORMAL mode

Expected behavior

When opening a file you should be in NORMAL mode by default.

Actual behavior

You're in REPLACE mode by default instead of NORMAL mode.


I believe this is specific to MS terminal because this problem doesn't happen with wsltty (another Windows terminal). I've also never seen this problem happen in native Linux on any terminal with the same vimrc file that I use.

The workaround for now is to set set t_u7= in your vimrc, but this conflicts with other terminals so it's not a bullet proof solution.

The interesting thing is the issue doesn't happen if you run vim -u NONE which disables user specific configuration, but this thread on StackOverflow makes it seem like it definitely is something stemming from the Windows terminal in the end https://superuser.com/a/1525060.

Originally created by @nickjj on GitHub (Sep 12, 2020). # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19041.508] Windows Terminal version (if applicable): Windows Terminal Preview / Version: 1.3.2382.0 ``` It's also worth pointing out the problem exists with the regular stable release of Windows Terminal too. # Steps to reproduce 1. Within Ubuntu 20.04 LTS WSL 2 install Vim with `sudo apt-get update && sudo apt-get install vim-gtk` 2. `touch test.txt` 3. `vim test.txt` 4. Notice that you're in REPLACE mode instead of NORMAL mode # Expected behavior When opening a file you should be in NORMAL mode by default. # Actual behavior You're in REPLACE mode by default instead of NORMAL mode. --- I believe this is specific to MS terminal because this problem doesn't happen with wsltty (another Windows terminal). I've also never seen this problem happen in native Linux on any terminal with the same vimrc file that I use. The workaround for now is to set `set t_u7=` in your vimrc, but this conflicts with other terminals so it's not a bullet proof solution. The interesting thing is the issue doesn't happen if you run `vim -u NONE` which disables user specific configuration, but this thread on StackOverflow makes it seem like it definitely is something stemming from the Windows terminal in the end https://superuser.com/a/1525060.
claunia added the Resolution-Duplicate label 2026-01-31 02:25:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10606