Skip to content

Commit

Permalink
Launch VS Code to handle path with space. (#265)
Browse files Browse the repository at this point in the history
Co-authored-by: Roberto Pastor Muela <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 17, 2024
1 parent ee2f854 commit f04ce11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ansys/tools/installer/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def _open_vscode(self):
"""Open VS code from path."""
# handle errors
path = self.vscode_window_path_config_edit.text().strip()
if os.path.exists(path):
if os.path.exists(rf"{path}"):
error_msg = "echo Failed to launch vscode. Try reinstalling code by following this link https://code.visualstudio.com/download"
self._parent.launch_cmd(f"code {path} && exit 0 || {error_msg}")
self._parent.launch_cmd(f'code "{path}" && exit 0 || {error_msg}')

self.user_confirmation_form.close()
self._parent.vscode_window.close()
Expand Down

0 comments on commit f04ce11

Please sign in to comment.