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

"Windows PowerShell" message line wrapped when opening integrated terminal #6733

Closed
weinand opened this issue May 24, 2016 · 11 comments
Closed
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
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented May 24, 2016

testing #6654:

  • VSCode Version: 1.1.0-alpha
  • OS Version: Windows 10

When opening the integrated terminal I see this:
2016-05-24 10-45-21

The message "Windows PowerShell" has a very large indent which makes it wrap at the edge of the view port. The native PowerShell console shows the message left aligned:

2016-05-24 10-51-39

@weinand weinand added the terminal General terminal issues that don't fall under another label label May 24, 2016
@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label May 24, 2016
@Tyriar Tyriar added this to the May 2016 milestone May 24, 2016
@Tyriar
Copy link
Member

Tyriar commented May 25, 2016

Note that this is less important now with cmd.exe becoming the default (#6886).

This is what the HTML shows:

<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;W</div>
<div>indows&nbsp;PowerShell</div>

@Tyriar
Copy link
Member

Tyriar commented May 25, 2016

The follow data is received from Powershell:

"�[?25l
�[0m�[0K
�[1G�[?25h"`

This is the one that adds all the spaces:

"�[?25l
�[64G�[?25h"
"�[?25l
Windows PowerShell�[0K
Copyright (C) 2016 Microsoft Corporation. All rights reserved.�[0K
�[0K
�[0K
�[1G�[?25h"

@Tyriar
Copy link
Member

Tyriar commented May 25, 2016

Stepped through the code, the second message is \e[?251\r\e[64G\e[?25h

\e[64G sets the position of the cursor to 64 (ie. 63 as its 0-based)
\e[?25h runs: this.cursorHidden = false;

@Tyriar
Copy link
Member

Tyriar commented May 25, 2016

We could intercept this message and fix this case, but the greater question is why Powershell would tell us to go to the 64th column. Powershell correctly passes \e[1G on most new lines with content.

@Tyriar
Copy link
Member

Tyriar commented May 25, 2016

Compare this to the first message from cmd:

"�[?25l
�[0mMicrosoft Windows [Version 10.0.14342]�[0K
↵(c) 2016 Microsoft Corporation. All rights reserved.�[0K
↵�[0K
↵c:\Users\Daniel>�[0K
�[17G�[?25h"

@Tyriar
Copy link
Member

Tyriar commented May 25, 2016

@lzybkr sorry to bother you again, but have you got any ideas on this? Powershell seems to be telling our terminal to go to the 64th character for some unknown reason.

@lzybkr
Copy link
Member

lzybkr commented May 26, 2016

PowerShell doesn't generate any VT100, and I don't see any code that sets the cursor position before displaying the logo - so I'm at a loss how that could happen. The banner message doesn't even start out with any whitespace or newlines.

@Tyriar
Copy link
Member

Tyriar commented May 26, 2016

Maybe it's pty.js doing this then, I'll have a look there thanks.

@Tyriar
Copy link
Member

Tyriar commented May 26, 2016

Looks like this is where it happens, still looking into why: https://github.com/platformio/pty.js/blob/prebuilt/deps/winpty/agent/Terminal.cc#L372

@Tyriar
Copy link
Member

Tyriar commented May 26, 2016

From my digging yesterday it seems like some obscure at the depths of the old version of winpty being used. Moving to backlog for now due to lower priority as well as no time to fix for May.

@Tyriar Tyriar modified the milestones: Backlog, May 2016 May 26, 2016
@Tyriar Tyriar added the windows VS Code on Windows issues label Jul 5, 2016
@Tyriar Tyriar removed the windows VS Code on Windows issues label Feb 16, 2017
@Tyriar Tyriar closed this as completed in 6e14e82 Feb 16, 2017
@Tyriar
Copy link
Member

Tyriar commented Feb 16, 2017

While I can't reproduce this anymore, I believe this was happening because the shell process did not have dimensions set on start up. To verify:

  • Verify powershell prompt doesn't wrap
  • Install an extension that uses the terminal API such as Terminal Here and launch the extension terminal to ensure there are no exceptions. The main two cases to check are:
    • The terminal is yet to be created (hide terminal and reload window)
    • The terminal visible

@Tyriar Tyriar modified the milestones: February 2017, Backlog Feb 16, 2017
@michelkaporin michelkaporin added the verified Verification succeeded label Feb 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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
Projects
None yet
Development

No branches or pull requests

4 participants