Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash for Windows terminals wrapping over 80 characters, terminals aren't sized correctly #106668

Closed
Ivan-Kouznetsov opened this issue Aug 29, 2020 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label verified Verification succeeded windows VS Code on Windows issues

Comments

@Ivan-Kouznetsov
Copy link

  • VSCode Version:
    1.48.2 (user setup)
    Commit: a047975
    Date: 2020-08-25T10:13:11.295Z
    Electron: 7.3.2
    Chrome: 78.0.3904.130
    Node.js: 12.8.1
    V8: 7.8.279.23-electron.0
    OS: Windows_NT x64 10.0.19041
  • Local OS Version: Windows_NT x64 10.0.19041
  • Remote OS Version: N/A
  • Remote Extension/Connection Type: Not using a remote connection

Steps to Reproduce:

  1. Enable Remote - WSL extension (I have version 0.44.4)
  2. Set Bash for Windows as default terminal
  3. Restart VS Code
  4. Open the terminal and type more than 80 characters in one line

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes

@Ivan-Kouznetsov
Copy link
Author

See this video for a demonstration of the bug: https://vimeo.com/452916914
Note that all other extensions are disabled. This issue does not occur when Remote - WSL is disabled.

@aeschli aeschli assigned Tyriar and unassigned aeschli Sep 9, 2020
@Tyriar Tyriar transferred this issue from microsoft/vscode-remote-release Sep 14, 2020
@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2020

This is nothing to do with remote-wsl or wsl in general, it happens when the extension is disabled as well.

@Tyriar Tyriar changed the title Remote - WSL causes cursor glitch in Bash for Windows for lines over 80 characters Bash for Windows terminals wrapping over 80 characters, terminals aren't sized correctly Sep 14, 2020
@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2020

I'm guessing this is related to the fact that the initial size of the terminal is 0x0 and immediately after start we send the correct dimensions:

image

These latter dimensions are correct, but maybe it's too early for conpty? Resizing the terminal after this has happened will fix the terminal.

@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2020

The fact that 0x0 is used initially followed by the actual dimensions right after is indeed the reason this doesn't work only for git bash under conpty.

The reason 0x0 is used (which falls back to 80x30) is a little more complicated. Historically we have provided the terminal container in order to get the dimensions of the terminal when we can, which may or may not have happened depending on how the terminal was created. Basically we could only get the dimensions if the terminal panel had been shown before and it was not going to be a split. But this seems to have fallen apart I think after integrating the terminal with the new "view" system.

Quick fix: Disallow IPty.resize to be called on Windows immediately after process creation
Proper fix: #106672

@Tyriar Tyriar added this to the September 2020 milestone Sep 14, 2020
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label windows VS Code on Windows issues labels Sep 14, 2020
@Tyriar Tyriar closed this as completed in 91bac85 Sep 14, 2020
@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2020

To verifier:

  1. On windows 19041 (or verify in stable you can repro)
  2. Set default shell to Git Bash via the Select Default Shell command
  3. Restart VS Code
  4. Create the first terminal
  5. Write characters and make sure it fills the viewport's width
  6. Create the second terminal
  7. Verify 5 again

@connor4312 connor4312 added the verified Verification succeeded label Oct 1, 2020
@connor4312
Copy link
Member

I was able to reproduce this in the recent insiders using a single terminal: https://memes.peet.io/img/20-10-3d8a2c7c-818b-4921-9c84-d78cf33d217e.mp4

@connor4312 connor4312 reopened this Oct 1, 2020
@connor4312 connor4312 added verification-found Issue verification failed and removed verified Verification succeeded labels Oct 1, 2020
@alexr00
Copy link
Member

alexr00 commented Oct 2, 2020

@connor4312 I repro'd the issue on stable, then tried in insiders and verified that it was fixed.

Given that this is intended to be a quick fix, and that there's an intended thorough fix (#106672), I'm going to close this and call it verified, since it does solve the issue for me.

@alexr00 alexr00 closed this as completed Oct 2, 2020
@alexr00 alexr00 added verified Verification succeeded and removed verification-found Issue verification failed labels Oct 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

6 participants
@Tyriar @connor4312 @aeschli @alexr00 @Ivan-Kouznetsov and others