visual-studio-code - 当 VS code 无法将文件保存到 SSH 远程服务器时,我该怎么办?

标签 visual-studio-code ssh

我今天使用 VS Code 编写了一些代码。突然,当我按下 CMD + s 时,VS Code 告诉我:

Failed to save 'example.py': Unable to write file

remote+123.255.255.255/data/example.py' (Canceled: Canceled)

当我打开另一个 SSH 远程项目时,SSH 连接看起来仍然有效。 然后我想也许备份是个好主意,所以我按下右下角的“另存为”按钮并输入路径“/data/example_backup.py”,它收到了警告:

Please enter a path that exists

即使我尝试了 /data/example.py,我仍然收到此警告。

然后show local按钮提醒我可以将此文件保存到本地磁盘。按下 show local 按钮并选择本地目录后,VS Code 做出了一些反馈:

Unable to read file 'vscode-remote://ssh-remote+123.255.255.255/data/example.py' (Canceled: Canceled)

但备份似乎有效,因为该文件已经位于本地文件夹中。

是否有解决方法可以重新连接 SSH 远程并再次保存?

最佳答案

例如,后面跟着 microsoft/vscode-remote-release issue 5215 (休眠后)或4686/3158 (WSL2)

为了进行测试,请尝试使用重新加载窗口命令,然后查看连接是否已恢复(正在进行的文件也已恢复,可以保存)。

关于visual-studio-code - 当 VS code 无法将文件保存到 SSH 远程服务器时,我该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68719915/

相关文章:

node.js - Visual Studio Code 调试器不会在 SAM Local 中的断点处停止

visual-studio-code - 通过命令 ID 或自定义字符串别名触发命令

node.js - 通过 SSH 在 Docker 中安装私有(private) npm 包

jenkins - 不使用插件从 Jenkins 进行 SSH

visual-studio-code - 整洁的标签,但对于 VSCode?

visual-studio-code - 更改代码中光标的颜色

java - 使用 Visual Studio Code Portable 下载 Java 扩展时出现问题

ios - 使用 ssh 将输入发送到 iphone 应用程序并打开

ubuntu - 用于 vim/tmux 的 headless SSH 服务器上的 xsel/xclip

linux - 不使用 ssh 在远程计算机上执行 postgresql 查询