vi display is garbled #162

Open
opened 2026-01-30 21:44:18 +00:00 by claunia · 0 comments
Owner

Originally created by @bitcrazed on GitHub (Feb 16, 2018).

From @raymod2 on April 12, 2017 16:32

  • A brief description

When editing a file in bash using vi the screen becomes garbled. This appears to happen when you first open a bash window. If you change the window height vi starts working correctly until you open a new bash window.

  • Expected results

The screen displays the file correctly.

  • Actual results (with terminal output if applicable)

The screen is garbled.

  • Your Windows build number

Version 1703 (OS Build 15063.0)

  • Steps / All commands required to reproduce the error from a brand new installation

Open a bash window. Right-click the title bar and select properties. Click the "Layout" tab and set "Height" to 40 in the "Window Size" size section. Click OK. Close the bash window. Open a new bash window (it should have a height of 40). Now open a vi instance. For example, type 'sudo visudo'. The first thing you will notice is that line 1 is not visible. Only lines 2 through 30 are displayed. If you press the up arrow key to scroll to line 1 nothing will happen. As you try to edit the file things get worse. Press 'o' to insert a new line. Now line 1 appears but it is labeled line 3. The new line you have created is labeled line 4 (but it should be line 2). The rest of the lines also have incorrect line numbers. Start entering text (type "foo"). The 'f' appears in the top line (now labeled line 4) and the "oo" appears in the second line (now labeled line 5) but interspersed with text from another line. As you can see everything is hopelessly garbled.

vi_garbled

  • Strace of the failing command

  • Required packages and commands to install

See our contributing instructions for assistance.

Copied from original issue: Microsoft/WSL#1895

Originally created by @bitcrazed on GitHub (Feb 16, 2018). _From @raymod2 on April 12, 2017 16:32_ * A brief description When editing a file in bash using vi the screen becomes garbled. This appears to happen when you first open a bash window. If you change the window height vi starts working correctly until you open a new bash window. * Expected results The screen displays the file correctly. * Actual results (with terminal output if applicable) The screen is garbled. * Your Windows build number Version 1703 (OS Build 15063.0) * Steps / All commands required to reproduce the error from a brand new installation Open a bash window. Right-click the title bar and select properties. Click the "Layout" tab and set "Height" to 40 in the "Window Size" size section. Click OK. Close the bash window. Open a new bash window (it should have a height of 40). Now open a vi instance. For example, type 'sudo visudo'. The first thing you will notice is that line 1 is not visible. Only lines 2 through 30 are displayed. If you press the up arrow key to scroll to line 1 nothing will happen. As you try to edit the file things get worse. Press 'o' to insert a new line. Now line 1 appears but it is labeled line 3. The new line you have created is labeled line 4 (but it should be line 2). The rest of the lines also have incorrect line numbers. Start entering text (type "foo"). The 'f' appears in the top line (now labeled line 4) and the "oo" appears in the second line (now labeled line 5) but interspersed with text from another line. As you can see everything is hopelessly garbled. ![vi_garbled](https://cloud.githubusercontent.com/assets/3221147/24968690/49b8e04a-1f6b-11e7-9550-b4f2987890cc.png) * Strace of the failing command * Required packages and commands to install See [our contributing instructions](/CONTRIBUTING.md) for assistance. _Copied from original issue: Microsoft/WSL#1895_
claunia added the Product-Conhost label 2026-01-30 21:44:18 +00:00
Sign in to join this conversation.
No Label Product-Conhost
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#162