About the Visual Studio Code Command Palette
命令调色板是 Visual Studio Code 的重点功能之一,可用于代码空间。 The VS Code Command Palette allows you to access many commands for Codespaces and Visual Studio Code. For more information on using the VS Code Command Palette, see "User Interface" in the Visual Studio Code documentation.
Accessing the VS Code Command Palette
You can access the VS Code Command Palette in a number of ways.
-
Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux).
请注意,此命令是 Firefox 中保留的键盘快捷键。
-
F1
-
从应用程序菜单点击 View > Command Palette…(查看命令调色板…)。
GitHub Codespaces 命令
To see all commands related to GitHub Codespaces, access the VS Code Command Palette, then start typing "Codespaces".
挂起或停止代码空间
If you add a new secret or change the machine type, you'll have to stop and restart the codespace for it to apply your changes.
To suspend or stop your codespace's container, access the VS Code Command Palette, then start typing "stop". 选择 Codespaces: Stop Current Codespace(Codespace:停止当前 Codespace)。
从模板添加开发容器
To add a dev container from a template, access the VS Code Command Palette, then start typing "dev container". 选择 Codespaces: Add Development Container Configuration Files...(Codespaces:添加开发容器配置文件...)
重建代码空间
如果您添加 dev 容器或编辑任何配置文件(devcontainer.json
和 Dockerfile
),则需要重建代码空间才可应用更改。
To rebuild your container, access the VS Code Command Palette, then start typing "rebuild". 选择 Codespaces: Rebuild Container(代码空间:重建容器)。
Codespaces 日志
You can use the VS Code Command Palette to access the codespace creation logs, or you can use it export all logs.
To retrieve the logs for Codespaces, access the VS Code Command Palette, then start typing "log". 选择 Codespaces: Export Logs(Codespaces:导出日志)以导出所有与 Codespaces 相关的日志,或选择 Codespaces: View Creation Logs(Codespaces:查看创建日志)以查看与设置相关的日志。