Adds quotes to command parameters with runInBash
set to false #426
Open
Description
Describe the bug
When running a command from a plugin that has <swiftbar.runInBash>false</swiftbar.runInBash>
configured, and the command has a parameter with a space in it, the command receives that parameter surrounded with single quotes.
To Reproduce
Steps to reproduce the behavior:
- Copy the
command.py
file below to~/Desktop/swiftbar-escape/command.py
- Add the
test.10s.py
file below to your plugin folder, adjusting the username in the path on line 6. - Wait until the “Python Test” plugin appears
- Python Test › Run Command
- Check
~/Dekstop/swiftbar-escape/python-command.log
, it will say['/Users/<your username>/Desktop/swiftbar-escape/command.py', "'foo bar'"]
Expected behavior
python-command.log
should say ['/Users/<your username>/Desktop/swiftbar-escape/command.py', 'foo bar']
, without the extra quotes
Environment:
- macOS version: Sequoia 15.0.1
- SwiftBar version: 2.0.0 (520)
Plugin Example:
test.10s.py:
#!/usr/bin/env python3
# <swiftbar.runInBash>false</swiftbar.runInBash>
print('Python Test')
print('---')
print('Run Command | bash=/Users/fenhl/Desktop/swiftbar-escape/command.py param1="foo bar" terminal=false')
command.py:
#!/usr/bin/env python3
import sys
import pathlib
with (pathlib.Path.home() / 'Desktop/swiftbar-escape/python-command.log').open('w') as f:
print(sys.argv, file=f)
Additional Context:
- I don't run Bartender/Dozer/etc. or tested the issue without it running
Metadata
Assignees
Labels
No labels
Activity