Visual Studio 代码:如何强制 "terminal" 实际显示远程终端本身

Visual Studio Code: How to force the "terminal" to actually display the remote terminal itself

我确定有上千个重复项,但我没有找到它们,因为我发现涉及本地终端,或者如果涉及远程终端,则假定实时终端视图已经存在。在我的例子中,终端的“终端”方面还不存在于终端窗格中。

设置:
Visual Studio 安装在 Win 10 上的代码在基于 Linux 的系统上进行远程开发。

问题:
当我启动 Visual Studio 代码时,它会自动将自己附加到远程系统。

但是,编辑 window 底部的终端窗格确实 NOT 包含“终端”,( 带有我可以输入命令的提示)。相反,它显示了 VS Code 努力连接远程计算机的输出,如下所示:

其中包含大量文字:

93f51b4f790b: running
Acquiring lock on /home/pi/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/vscode-remote-lock.pi.899d46d82c4c95423fb7e10e68eba52050e30ba3
Found existing installation at /home/pi/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3...
Checking /home/pi/.vscode-server/.899d46d82c4c95423fb7e10e68eba52050e30ba3.log and /home/pi/.vscode-server/.899d46d82c4c95423fb7e10e68eba52050e30ba3.pid for a running server
Looking for server with pid: 4285
Starting server with command... /home/pi/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown --port=0 --disable-telemetry   &> "/home/pi/.vscode-server/.899d46d82c4c95423fb7e10e68eba52050e30ba3.log" < /dev/null
printenv:
    SHELL=/bin/bash
    PWD=/home/pi
    LOGNAME=pi
    XDG_SESSION_TYPE=tty
    LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so
    HOME=/home/pi
    LANG=en_US.UTF-8
    VSCODE_AGENT_FOLDER=/home/pi/.vscode-server
    SSH_CONNECTION=172.31.100.209 1025 172.31.100.20 22
    XDG_SESSION_CLASS=user
    USER=pi
    SHLVL=0
    XDG_SESSION_ID=7
    XDG_RUNTIME_DIR=/run/user/1000
    SSH_CLIENT=172.31.100.209 1025 22
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
    DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
    MAIL=/var/mail/pi
    _=/usr/bin/printenv
Spawned remote server: 22461
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
Waiting for server log...
 
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*

93f51b4f790b: start
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==40669==
osReleaseId==raspbian==
arch==armv7l==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==1088==
connectionToken==c996da7e-f0ac-4ecf-b214-07c49b988569==
93f51b4f790b: end

没有终端提示符,也没有任何输入命令的方法。

(恕我直言,这应该在“输出”window 而不是终端 window。)

如果我打开一个 python 文件并执行它,这个 window 会神奇地变成一个我可以使用的实时终端 window。

正是出于这个原因,我创建了一个小的 Python 程序来强制终端 window 成为 终端 window:

# Open the terminal window
# A butt-ugly hack to force the VS Code terminal to be a terminal

print("Yippee! a terminal window!")

在我运行它之后,我的终端window是一个真正的终端window。这是一个丑陋的 hack,我相信有办法解决。

我的问题:
如何让我的终端成为一个真实的、活的、诚实的Linux终端而不必运行什么东西?

谢谢!

如果你点击 Terminal 然后 New Terminal,你应该在远程环境中得到一个新的终端。