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

Terminal is always launching externally when ConPTY is turned on #73790

Closed
GollyJer opened this issue May 15, 2019 · 31 comments
Closed

Terminal is always launching externally when ConPTY is turned on #73790

GollyJer opened this issue May 15, 2019 · 31 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues terminal-conpty Integrated terminal issues related to the ConPTY backend upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Milestone

Comments

@GollyJer
Copy link

I can't get the terminal to launch integrated. It always launches externally.
More details in this StackOverflow question.

System Info
image

I'm not sure if this is a bug or user error.
Steps to Reproduce:

  1. Open vscode.
  2. Pres ctrl + ~.

Does this issue occur when all extensions are disabled?: Yes

Thanks for any help! 👍

@vscodebot vscodebot bot added the terminal Integrated terminal issues label May 15, 2019
@mtnair
Copy link

mtnair commented May 16, 2019

Are you on Windows 10 Update 1903? I have the same problem on this build.

@GollyJer
Copy link
Author

GollyJer commented May 16, 2019

Are you on Windows 10 Update 1903? I have the same problem on this build.

Yes

image

@chnldw
Copy link

chnldw commented May 17, 2019

Same issue here. I'm on 1903 as well. vscode 1.34.0

@Tyriar
Copy link
Member

Tyriar commented May 20, 2019

Can you share your settings.json file?

@Tyriar Tyriar added the info-needed Issue requires more information from poster label May 20, 2019
@GollyJer
Copy link
Author

Fresh install. 🙂

image

@Tyriar
Copy link
Member

Tyriar commented May 20, 2019

@GollyJer can you try with the Insiders build tomorrow? I made some changes just today around this area. https://code.visualstudio.com/insiders

@GollyJer
Copy link
Author

@Tyriar Sure... I'll keep you posted. Thanks! 👍

@GollyJer
Copy link
Author

No change. Sorry.

image

@Tyriar
Copy link
Member

Tyriar commented May 22, 2019

Weird, I don't suppose you have anything in your keybindings.json either?

Does disabling the Windows Enable Conpty setting affect it? Also what is the comspec environment variable set to?

@mtnair
Copy link

mtnair commented May 22, 2019

Yes, disabling Windows Enable Conpty works, the terminal launches in VS Code. Even in the stable build.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal-conpty Integrated terminal issues related to the ConPTY backend and removed info-needed Issue requires more information from poster labels May 22, 2019
@Tyriar Tyriar added this to the Backlog milestone May 22, 2019
@GollyJer
Copy link
Author

GollyJer commented May 23, 2019

Turning of ConPTY worked for me. 👍
Removing all keybindings didn't help.

To answer your questions...

keybindings

[
  {
    "key": "ctrl+tab",
    "command": "workbench.action.nextEditor"
  },
  {
    "key": "ctrl+shift+tab",
    "command": "workbench.action.previousEditor"
  },
  {
    "key": "alt+f",
    "command": "-gitlens.showCommitSearch",
    "when": "gitlens:enabled"
  },
  {
    "key": "ctrl+tab",
    "command": "-workbench.action.openNextRecentlyUsedEditorInGroup"
  },
  {
    "key": "ctrl+tab",
    "command": "-workbench.action.quickOpenNavigateNextInEditorPicker",
    "when": "inEditorsPicker && inQuickOpen"
  },
  {
    "key": "ctrl+s",
    "command": "workbench.action.files.saveAll"
  },
  {
    "key": "ctrl+k s",
    "command": "-workbench.action.files.saveAll"
  },
  {
    "key": "ctrl+k s",
    "command": "workbench.action.files.save"
  },
  {
    "key": "ctrl+s",
    "command": "-workbench.action.files.save"
  },
  {
    "key": "ctrl+k ctrl+c",
    "command": "workbench.action.toggleCenteredLayout"
  },
  {
    "key": "ctrl+`",
    "command": "workbench.action.terminal.focus"
  },
  {
    "key": "ctrl+shift+x",
    "command": "multiCommand.reRun",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+,",
    "command": "workbench.action.openSettingsJson"
  },
  {
    "key": "ctrl+.",
    "command": "-settings.action.editFocusedSetting",
    "when": "inSettingsSearch"
  },
  {
    "key": "shift+alt+s",
    "command": "python.sortImports"
  }
]

comspec

image

@GollyJer
Copy link
Author

GollyJer commented May 23, 2019

Answer... for now. 😀
https://stackoverflow.com/questions/56154957

@luchoespejo
Copy link

the solution for mee.
1 - Go to https://code.visualstudio.com/insiders/ and install Version: 1.35.0-insider
2 - Go to File/Preferences/Settings
3 - Search conPTY and disable --> Terminal › Integrated: Windows Enable Conpty

image

image

@mtnair
Copy link

mtnair commented May 24, 2019

@luchoespejo See a few answers before, it already has been pointed out.

@Tyriar
Copy link
Member

Tyriar commented May 31, 2019

@zadjii-msft any ideas? ConPTY is launching an external conhost, turning on winpty works.

@Tyriar Tyriar changed the title Terminal is always launching externally. Terminal is always launching externally when ConPTY is turned on May 31, 2019
@zadjii-msft
Copy link
Member

... No, I haven't the faintest clue why this isn't working.

Does the integrated terminal window display anything, or is it just blank?

Does the conhost window that appears have a scrollbar?

If the VS Code terminal is displaying something, then maybe the conhost that's getting launched to host conpty is not in headless mode (somehow).

If it's totally blank, then I'd imagine that somehow the conhost doesn't think that it's getting activated in conpty mode. Conhost will think it's in conpty mode as long as it has one of the pipes (in/out/signal), and if it's being activated via the API, it should definitely have at least the signal pipe.

@Tyriar
Copy link
Member

Tyriar commented May 31, 2019

@zadjii-msft looks like the integrated terminal is blank based on https://stackoverflow.com/q/56154957/1156119

@zadjii-msft
Copy link
Member

Huh. That's kinda what I imagined, though I'm not sure it really helps psychic debug it. I can't get this to repro locally, so I'm not sure how to be able to debug this further. Maybe it has something to do with OS architecture vs VS Code architecture?

@GollyJer do you have WSL installed? If you do, could you try running cmd.exe from within a wsl prompt? That should activate another conpty, and hopefully help narrow down where this is originating from.

@Tyriar
Copy link
Member

Tyriar commented May 31, 2019

I haven't repro'd it either, but it has been reported a few times. The code responsible for using conpty is at https://github.com/microsoft/node-pty/blob/master/src/win/conpty.cc if that helps.

@GollyJer
Copy link
Author

GollyJer commented May 31, 2019

@zadjii-msft This is strange. I just reenabled Conpty in vscode settings and integrated terminal is working.

To answer your question... yes. I have WSL enabled and Ubuntu installed. Running cmd in bash activated an inline command prompt.

The major change I've made to my system is uninstalling Docker Desktop and disabling HyperV. I had to use VMWare Workstation which doesn't work in conjunction with HyperV.

I don't have time to turn on HyperV and reinstall Docker Desktop today (to test if it's the culprit) but I can at some point if necessary.

Do other's in this thread have Docker installed?

@adrianinfinitum
Copy link

Ran into this same problem and the conpty workaround that @GollyJer posted worked for me.

I'm on Windows 10 Pro (Build 1903) and running Docker for Windows Desktop.

Version: 1.36.1 (system setup)
Commit: 2213894
Date: 2019-07-08T22:58:59.274Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT ia32 10.0.18362

@Tyriar Tyriar added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jul 13, 2019
@Tyriar
Copy link
Member

Tyriar commented Jul 13, 2019

@zadjii-msft I've gotten quite a few reports for this, still can't repro myself though and I don't know what I can do or ask to help.

@yth2012
Copy link

yth2012 commented Jul 15, 2019

encountered the same problem. besides the method provided above I also found that by unchecking the "use legacy console" option in cmd/powershell it is able to run in vscode integrated console as before (at least for me)

@zadjii-msft
Copy link
Member

unchecking the "use legacy console" option

Oh my god that's 100% it. Just this week we figured out that if you're using the v1 console, that also affects conpty, and launches the v1 console instead of conpty. We actually just made some changes to the OS this week to force conpty to use the v2 console, so hopefully this will be fixed in Insiders soontm

@Tyriar
Copy link
Member

Tyriar commented Jul 17, 2019

@zadjii-msft is there a microsoft/terminal issue tracking this?

@Tyriar Tyriar added the windows VS Code on Windows issues label Jul 17, 2019
@zadjii-msft
Copy link
Member

Yep! There's microsoft/terminal#1838 and microsoft/terminal#1935

@Scorpibear
Copy link

Reproduced at Windows 10 Enterprise build 18362, VS Code v1.37.1. With ConPTY setting turn on, all tried terminals (PS 1.0, PS 6.0, bash) are run in external window. With turning off the setting, it is immediately fixes the issue.

@gorban
Copy link

gorban commented Sep 4, 2019

I encountered this same issue and disabling ConPTY for the integrated terminal fixed it for me (no more external Powershell windows are popping up and it works integrated in VS Code). This only started happening when installed Windows 1903.

@Tyriar
Copy link
Member

Tyriar commented Sep 5, 2019

@Scorpibear @gorban do not turn conpty off, turn off "use legacy console" in your conhost settings: #73790 (comment)

@StdGit
Copy link

StdGit commented Sep 30, 2019

@Tyriar What if I have windows 7 enterprise.
I have the same issue.

@Tyriar
Copy link
Member

Tyriar commented Sep 30, 2019

@StdGit that's using a different system (winpty) that we are no longer improving upon, I'm not sure how you would fix that.

Closing since this is fixed in a future version of Windows 10 microsoft/terminal#1838 and nothing more to action.

@Tyriar Tyriar closed this as completed Sep 30, 2019
@microsoft microsoft locked and limited conversation to collaborators Sep 30, 2019
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 Integrated terminal issues terminal-conpty Integrated terminal issues related to the ConPTY backend upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests