Skip to content

Commit f04ce11

Browse files
anssakthiRobPasMuepre-commit-ci[bot]
authored
Launch VS Code to handle path with space. (#265)
Co-authored-by: Roberto Pastor Muela <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ee2f854 commit f04ce11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ansys/tools/installer/vscode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def _open_vscode(self):
115115
"""Open VS code from path."""
116116
# handle errors
117117
path = self.vscode_window_path_config_edit.text().strip()
118-
if os.path.exists(path):
118+
if os.path.exists(rf"{path}"):
119119
error_msg = "echo Failed to launch vscode. Try reinstalling code by following this link https://code.visualstudio.com/download"
120-
self._parent.launch_cmd(f"code {path} && exit 0 || {error_msg}")
120+
self._parent.launch_cmd(f'code "{path}" && exit 0 || {error_msg}')
121121

122122
self.user_confirmation_form.close()
123123
self._parent.vscode_window.close()

0 commit comments

Comments
 (0)