동일한 창 VS 코드에서 통합 WSL 터미널을 사용하여 파일 열기

동일한 창 VS 코드에서 통합 WSL 터미널을 사용하여 파일 열기

통합 터미널을 사용하여 VS 코드에서 파일을 열려고 합니다. 파일이 동일한 인스턴스 대신 새 창에서 계속 열립니다. 동일한 인스턴스의 새 탭에서 열리도록 모든 창 설정을 설정했는데 터미널을 통해 파일을 열려고 할 때만 이런 식으로 작동합니다.

답변1

-r 옵션을 사용할 수 있습니다.

$ code -r your.file

코드의 --help에서 얻었습니다.

$ code --help
code 1.61.0

Usage: code [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -a --add <folder>                 Add folder(s) to the last active window.
  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an already opened window.
  -w --wait                         Wait for the files to be closed before returning.
  -h --help                         Print usage.

Extensions Management
  --list-extensions                                           List the installed extensions.
  --show-versions                                             Show versions of installed extensions, when using --list-extensions.
  --category <category>                                       Filters installed extensions by provided category, when using --list-extensions.
  --install-extension <extension-id[@version] | path-to-vsix> Installs or updates the extension. The identifier of an extension is always
                                                          
`${publisher}.${name}`. Use `--force` argument to update to latest version. To install a specific version provide `@${version}`. For example: '[email protected]'.
  --uninstall-extension <extension-id>                        Uninstalls an extension.

Troubleshooting
  -v --version Print version.
  -s --status  Print process usage and diagnostics information.

관련 정보