简体   繁体   English

Visual Studio Code:如何强制“终端”实际显示远程终端本身

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

I am sure there are a thousand duplicates, but I have not found them as what I have found involve the local terminal, or if about the remote terminal, it is assumed that the live terminal view already exists.我确信有一千个重复项,但我没有找到它们,因为我发现它们涉及本地终端,或者如果关于远程终端,则假定实时终端视图已经存在。 In my case the "terminal" aspect of the terminal does not yet exist within the terminal pane.在我的情况下,终端的“终端”方面尚不存在于终端窗格中。

Setup:设置:
Visual Studio Code installed on Win 10 doing remote development on a Linux based system.安装在 Win 10 上的 Visual Studio Code 在基于 Linux 的系统上进行远程开发。

Issue:问题:
When I start Visual Studio Code, it automatically attaches itself to the remote system, as it should.当我启动 Visual Studio Code 时,它会自动将自己附加到远程系统,这是应该的。

However, the terminal pane at the bottom of the editing window does NOT contain a "terminal", ( ie with a prompt that I can type commands into).但是,编辑 window 底部的终端窗格包含“终端”(我可以输入命令的提示)。 Instead it shows the output of VS Code's efforts to connect with the remote machine as shown below:相反,它显示了 VS Code 与远程机器连接的努力的 output,如下所示:

在此处输入图像描述

Which contains a lot of text:其中包含大量文字:

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

There is no terminal prompt, nor is there any way to type commands.没有终端提示,也没有任何输入命令的方法。

(IMHO this should be in the "OUTPUT" window instead of the terminal window.) (恕我直言,这应该在“输出”window 而不是终端 window 中。)

If I open a python file and execute it, this window magically changes into a real-live terminal window that I can use.如果我打开一个 python 文件并执行它,这个 window 会神奇地变成我可以使用的真实终端 window。

Just for that reason, I created a tiny Python program just to force the terminal window to be a terminal 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!")

After I run it, my terminal window is a real terminal window.运行后,我的终端 window 是真正的终端 window。 This is an UGLY hack that I am sure there's a way around.这是一个丑陋的黑客,我相信有办法解决。

My question:我的问题:
How do I make my terminal into a real, live, honest-to-Linux terminal without having to run something?如何使我的终端成为一个真实的、活的、诚实的 Linux终端,而无需运行某些东西?

Thanks!谢谢!

If you click Terminal then New Terminal , you should get a fresh terminal inside remote environment.如果您单击Terminal然后New Terminal ,您应该在远程环境中获得一个新的终端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM