JonnyHaystack / i3-resurrect

Simple solution to saving and restoring i3 workspaces
GNU General Public License v3.0
378 stars 19 forks source link

Programs having names consisting comma do not launch while restoring #77

Closed ashish-yadav11 closed 4 years ago

ashish-yadav11 commented 4 years ago

Okular open with file having name starting with comma doesn't launch while restoring.

Steps to reproduce the behavior;

  1. run okular -- "file name having comma in it"
  2. save the workspace having the okular window
  3. restore it
  4. okular will not launch

Expected behavior okular should launch

System information (please complete the following information):

ashish-yadav11 commented 4 years ago

The problem is in line 100, i.e., i3.command(f'exec cd "{working_directory}" && {command}') of i3_resurrect/programs.py.

ashish-yadav11 commented 4 years ago

My current workaround is to replace line 100 with os.system(f'cd "{working_directory}" && {command} & disown').

ashish-yadav11 commented 4 years ago

One question out of the context; can't python-i3ipc in the official repo in arch be used instead of i3ipc-python-git in aur?

JonnyHaystack commented 4 years ago

My current workaround is to replace line 100 with os.system(f'cd "{working_directory}" && {command} & disown').

See #40 for why I use i3's exec command

One question out of the context; can't python-i3ipc in the official repo in arch be used instead of i3ipc-python-git in aur?

See #72 and #74, and everyone installing these AUR packages should have no trouble installing another AUR package as a dependency.

ashish-yadav11 commented 4 years ago

The following resolves the issue too - replace cmdline = [f'"{arg}"' for arg in cmdline if arg != ''] on line 94 in programs.py with cmdline = [f'\\"{arg}\\"' for arg in cmdline if arg != ''] and i3.command(f'exec cd "{working_directory}" && {command}') on line 100 with i3.command(f'exec "cd \\"{working_directory}\\" && {command}"'). See https://github.com/i3/i3/issues/2122.

JonnyHaystack commented 4 years ago

Ok thanks! I'll look into that

JonnyHaystack commented 4 years ago

The following resolves the issue too - replace cmdline = [f'"{arg}"' for arg in cmdline if arg != ''] on line 94 in programs.py with cmdline = [f'\\"{arg}\\"' for arg in cmdline if arg != ''] and i3.command(f'exec cd "{working_directory}" && {command}') on line 100 with i3.command(f'exec "cd \\"{working_directory}\\" && {command}"'). See i3/i3#2122.

So does this actually work if the command has a comma in it or does it only fix the case where there's a comma in the working directory path?

EDIT: Ah nevermind