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

Git Bash/winpty - blank lines when wrapping in interactive cli #45682

Closed
monk-time opened this issue Mar 13, 2018 · 2 comments
Closed

Git Bash/winpty - blank lines when wrapping in interactive cli #45682

monk-time opened this issue Mar 13, 2018 · 2 comments
Assignees
Labels
terminal General terminal issues that don't fall under another label

Comments

@monk-time
Copy link

Issue Type: Bug

I'm using Git Bash (2.16.2.windows.1, the latest version) as integrated terminal on Win7x64. The recommended way of launching interactive console programs with this setup is through winpty, and it worked fine in VSCode ~1.17-1.20.

After updating to 1.21.0, when I run such programs (e.g. python/haskell/node REPLs) through winpty in the VSCode's integrated terminal (Git Bash) it now adds a blank line after each wrapped line. Same happens in a fresh copy (no settings/extensions) of today's VSCode Insiders.

Steps to reproduce:

  1. Set C:\\Program Files\\Git\\bin\\bash.exe as the integrated terminal.
  2. Run in the terminal: winpty python, print(list(range(150)))
    Or: winpty node, 'a'.repeat(500)
    Or: winpty stack exec ghci, [1..150]

Current behavior: multiple blank lines are printed in the output of this command.
Expected behavior: no blank lines.

Illustration: (I'm calling "python" to disable my alias)
code - insiders_2018-03-13_19-48-43

Possible workaround: python/node/stack exec ghci without winpty wraps lines properly, but at the very least navigating command history with arrow keys in python repl is broken. Issues like that (Git Bash as external terminal is unable to run python/node without winpty at all) are what necessitates using winpty, but seems like something related to the console splitting feature in 1.21 broke that.


VS Code version: Code - Insiders 1.22.0-insider (1126701, 2018-03-13T05:16:22.707Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 x 2494)
Memory (System) 15.92GB (9.56GB free)
Process Argv D:\VSCode-win32-x64-1.22.0-insider\Code - Insiders.exe
Screen Reader no
VM 0%
Extensions: none

Reproduces without extensions

@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Mar 13, 2018
@Tyriar
Copy link
Member

Tyriar commented Mar 16, 2018

@monk-time the shell is launched using winpty though, I never really expected running it through winpty multiple times to work. I have seen some things are broken in sub-shells though like python and ghci.

Closing off to keep issue count lower but I'll add it to the list.

@Tyriar Tyriar closed this as completed Mar 16, 2018
@monk-time
Copy link
Author

I see. I solved this by wrapping my python="winpty python" etc. aliases in .bashrc in a conditional check for $TERM_PROGRAM, but the reason I had them in the first place is that setting up aliases in that way is a popular recommendation ([1], [2], [3]) for Git Bash users, and it's likely that some users also have similar setups that no longer work as expected.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

2 participants