microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.55k stars 265 forks source link

Failure to Use Integrated Terminal During Debug Session #7226

Closed jcalabro closed 1 year ago

jcalabro commented 1 year ago
Expand ``` [13:51:31.220] Log Level: 2 [13:51:31.221] remote-ssh@0.84.0 [13:51:31.221] darwin arm64 [13:51:31.234] SSH Resolver called for "ssh-remote+_redacted_", attempt 1 [13:51:31.235] "remote.SSH.useLocalServer": false [13:51:31.235] "remote.SSH.showLoginTerminal": false [13:51:31.235] "remote.SSH.remotePlatform": _redacted_ [13:51:31.235] "remote.SSH.path": undefined [13:51:31.235] "remote.SSH.configFile": undefined [13:51:31.235] "remote.SSH.useFlock": true [13:51:31.235] "remote.SSH.lockfilesInTmp": false [13:51:31.235] "remote.SSH.localServerDownload": auto [13:51:31.236] "remote.SSH.remoteServerListenOnSocket": true [13:51:31.236] "remote.SSH.showLoginTerminal": false [13:51:31.236] "remote.SSH.defaultExtensions": [] [13:51:31.236] "remote.SSH.loglevel": 2 [13:51:31.236] "remote.SSH.enableDynamicForwarding": true [13:51:31.236] "remote.SSH.enableRemoteCommand": false [13:51:31.236] "remote.SSH.serverPickPortsFromRange": {} [13:51:31.236] "remote.SSH.serverInstallPath": {} [13:51:31.239] SSH Resolver called for host: _redacted_ [13:51:31.239] Setting up SSH remote "_redacted_" [13:51:31.241] Using commit id "74b1f979648cc44d385a2286793c226e611f59e7" and quality "stable" for server [13:51:31.244] Install and start server if needed [13:51:31.245] PATH: /Users/jcalabro/go/bin:/Users/jcalabro/.yarn/bin:/Users/jcalabro/.config/yarn/global/node_modules/.bin:/Users/jcalabro/.pyenv/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/jcalabro/.pyenv/shims:/opt/rh/devtoolset-10/root/bin:usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jcalabro/.local/bin:/Users/jcalabro/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/Users/jcalabro/.bin:/Users/jcalabro/.bin/bin:/Users/jcalabro/.bin/zig:/Users/jcalabro/.bin/nodejs/bin:/Users/jcalabro/.bin/go/bin:/Users/jcalabro/.cargo/bin:/Users/jcalabro/misc/4coder:/Users/jcalabro/misc/nand2tetris/tools:/opt/homebrew/bin:/opt/homebrew/opt/llvm/bin:/usr/local/sbin:/Users/jcalabro/go/bin [13:51:31.245] Checking ssh with "ssh -V" [13:51:31.250] > OpenSSH_8.6p1, LibreSSL 3.3.6 [13:51:31.251] Running script with connection command: ssh -T -D 59238 -o ConnectTimeout=15 _redacted_ bash [13:51:35.253] > stty: 'standard input': Inappropriate ioctl for device > 07026c461d2d: running > Acquiring lock on /home/jcalabro/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7/vscode-remote-lock.jcalabro.74b1f979648cc44d385a2286793c226e611f59e7 > Found existing installation at /home/jcalabro/.vscode-server/bin/74b1f979648cc44d385a2286793c226e611f59e7... > Checking /home/jcalabro/.vscode-server/.74b1f979648cc44d385a2286793c226e611f59e7.log and /home/jcalabro/.vscode-server/.74b1f979648cc44d385a2286793c226e611f59e7.pid for a running server > Looking for server with pid: 148604 > Found running server... > > * > * Reminder: You may only use this software with Visual Studio family products, > * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057) > * > > Checking server status on socket /run/user/1000/vscode-ssh-remote-server-sock-1663867707 with curl > 07026c461d2d: start > SSH_AUTH_SOCK==/tmp/ssh-XXXXXXAzMZX4/agent.160698== > DISPLAY==== > webUiAccessToken==== > listeningOn==/run/user/1000/vscode-ssh-remote-server-sock-1663867707== > osReleaseId==rocky== > arch==x86_64== > tmpDir==/run/user/1000== > platform==linux== > unpackResult==== > didLocalDownload==0== > downloadTime==== > installTime==== > extInstallTime==== > serverStartTime==== > connectionToken==1a1aa1a1-a111-1111-1111-a1a11a1aa111== > 07026c461d2d: end [13:51:35.254] Got some output, clearing connection timeout [13:51:35.254] Received install output: SSH_AUTH_SOCK==/tmp/ssh-XXXXXXAzMZX4/agent.160698== DISPLAY==== webUiAccessToken==== listeningOn==/run/user/1000/vscode-ssh-remote-server-sock-1663867707== osReleaseId==rocky== arch==x86_64== tmpDir==/run/user/1000== platform==linux== unpackResult==== didLocalDownload==0== downloadTime==== installTime==== extInstallTime==== serverStartTime==== connectionToken==1a1aa1a1-a111-1111-1111-a1a11a1aa111== [13:51:35.254] Remote server is listening on /run/user/1000/vscode-ssh-remote-server-sock-1663867707 [13:51:35.255] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"socketPath":"/run/user/1000/vscode-ssh-remote-server-sock-1663867707"},"osReleaseId":"rocky","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-XXXXXXAzMZX4/agent.160698","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1a1aa1a1-a111-1111-1111-a1a11a1aa111"},"installUnpackCode":""} [13:51:35.256] Running script with connection command: ssh -T -L 127.0.0.1:59242:/run/user/1000/vscode-ssh-remote-server-sock-1663867707 -o ConnectTimeout=15 _redacted_ bash [13:51:35.256] Spawning tunnel with: ssh -T -L 127.0.0.1:59242:/run/user/1000/vscode-ssh-remote-server-sock-1663867707 -o ConnectTimeout=15 _redacted_ bash << 'EOSSH' echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK && echo -e 'Connected to SSH Host - Please do not close this terminal' && while true; do sleep 180; echo -n ' '; done EOSSH [13:51:37.216] > stty: 'standard input': Inappropriate ioctl for device > SSH_AUTH_SOCK=/tmp/ssh-XXXXXXkUbIRt/agent.160800 > Connected to SSH Host - Please do not close this terminal [13:51:37.217] Spawned SSH tunnel between local port 59242 and remote target /run/user/1000/vscode-ssh-remote-server-sock-1663867707 [13:51:37.218] Waiting for ssh tunnel to be ready [13:51:37.221] Tunneled /run/user/1000/vscode-ssh-remote-server-sock-1663867707 to local port 59242 [13:51:37.221] Resolved "ssh-remote+_redacted_" to "127.0.0.1:59242" [13:51:37.222] Updating $SSH_AUTH_SOCK: ln -f -s "/tmp/ssh-XXXXXXAzMZX4/agent.160698" "/run/user/1000/vscode-ssh-auth-sock-65567466" [13:51:37.223] Using cwd: vscode-remote://ssh-remote%2B_redacted_/ [13:51:37.223] Remote extension host environment: {"SSH_AUTH_SOCK":"/run/user/1000/vscode-ssh-auth-sock-65567466"} [13:51:37.232] ------ [13:51:38.889] "Update SSH_AUTH_SOCK" terminal command done ```

Steps to Reproduce:

Here is a simple Go script to reproduce the issue:

package main

import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    reader := bufio.NewReader(os.Stdin)
    fmt.Print("Enter text: ")
    text, err := reader.ReadString('\n')
    if err != nil {
        panic(err)
    }
    fmt.Println(text)
}

and a launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/main.go",
            "console": "integratedTerminal"
        }
    ]
}

Does this issue occur when you try this locally?: No Does this issue occur when you try this locally and all extensions are disabled?: No (minus the Go debugger extension)

This is causing me to be unable to debug a TUI application that requires running on Linux. No issues when I log in via VNC and debug locally; this is only happening over SSH.

Here's a screenshot that shows that the wrong "console" is being selected by VS code.

Screen Shot 2022-09-22 at 1 57 03 PM
roblourens commented 1 year ago

Showing the debug console is controlled independently. It's often still useful even when the program is executed in the terminal. You might want to set "debug.internalConsoleOptions": "neverOpen" if you never want this