sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
12.95k stars 972 forks source link

Causes VSCode to always create a new integrated terminal (unintended) #453

Open Removed-5an opened 5 years ago

Removed-5an commented 5 years ago
### General information - Pure version: latest - ZSH version: 5.3 - Terminal program & version: iTerm

I have:

Problem description

When using VSCode with integrated terminal debugger every time your restart the debugger vscode creates a new terminal window. This does not happen with bash nor with ZSH with any other theme.

I narrowed it down to the usage of zsh-async somehow.

launch.json:

      "console": "integratedTerminal"

Reproduction steps

  1. Have VSCode create a simple node.js project that you can debug with integrated terminal
  2. Use zplug and load pure and zsh-async
  3. Debug a vscode Node.js project and restart the debugger.

My .zshrc:

source $HOME/.zplug/init.zsh

# zplug plugins
zplug mafredri/zsh-async, from:github

# zplug theme
zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme

# Install packages that have not been installed yet
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    else
        echo
    fi
fi

zplug load
mafredri commented 5 years ago

@5an1ty could you try out the no-zpty branch of zsh-async?

Keep in mind, it's not feature complete and just a very quick hack, but it mostly works as a drop-in for the current implementation sans some features (like unique job control, flushing, etc).

I'm pretty sure this issue is related to zpty and I don't think there's a way around it without using an alternative method for async execution.

Removed-5an commented 5 years ago

@mafredri Thanks, but that didn't really help. Changed my zplug to this:

zplug "mafredri/zsh-async", at:no-zpty from:github

And execute zplug update

but didn't really seem to change anything in vscode.

mafredri commented 5 years ago

Did you confirm it changed the branch? I'm no zplug expert but judging from the documentation it seems there should be a , between at and from.

Removed-5an commented 5 years ago

Yes there was a missing comma, but I manually checked out the correct branch:

~/.zplug/repos/mafredri/zsh-async no-zpty ❯ git status On branch no-zpty Your branch is up to date with 'origin/no-zpty'.

nothing to commit, working tree clean

mafredri commented 5 years ago

Ok, thanks for confirming. My hunch was that zpty would cause VS Code to be confused about the shell but it seems that is not the case.

Could you point me to a sample project I can try to reproduce this with? I have never used this feature of Code so not sure where to start.

Removed-5an commented 5 years ago

Very odd, I tried creating a new blank js project and I can't reproduce it. It's specific to one repo it seems. I'll try and update the issue if I figure something out.