Skip to content

Commit

Permalink
fix: Handle spaces for 'launch <appname>' in OSX (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
splondike authored Jul 23, 2023
1 parent 8dcd4bb commit 468fb16
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/app_switcher/app_switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,15 @@ def switcher_focus_window(window: ui.Window):

def switcher_launch(path: str):
"""Launch a new application by path (all OSes), or AppUserModel_ID path on Windows"""
if app.platform != "windows":
# separate command and arguments
if app.platform == "mac":
ui.launch(path=path)
elif app.platform == "linux":
# Could potentially be merged with OSX code. Done in this explicit
# way for expediency around the 0.4 release.
cmd = shlex.split(path)[0]
args = shlex.split(path)[1:]
ui.launch(path=cmd, args=args)
else:
elif app.platform == "windows":
is_valid_path = False
try:
current_path = Path(path)
Expand All @@ -344,6 +347,8 @@ def switcher_launch(path: str):
else:
cmd = f"explorer.exe shell:AppsFolder\\{path}"
subprocess.Popen(cmd, shell=False)
else:
print("Unhandled platform in switcher_launch: " + app.platform)

def switcher_menu():
"""Open a menu of running apps to switch to"""
Expand Down

0 comments on commit 468fb16

Please sign in to comment.