Skip to content

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

Closed

Description

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

Activity

  1. added
    terminal
    on Mar 13, 2018
  2. Tyriar commented on Mar 16, 2018

    @Tyriar
    Contributor

    Dmitry Bogorad (@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.

  3. monk-time commented on Mar 16, 2018

    @monk-time
    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.

  4. locked and limited conversation to collaborators on Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

terminal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions