Skip to content

Commit

Permalink
fixed crash when using fish shell
Browse files Browse the repository at this point in the history
  • Loading branch information
lighttigerXIV committed May 2, 2023
1 parent 3307b06 commit d6bc215
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ def on_event(self, event, extension):
terminal = extension.preferences["term"]
exec = extension.preferences["exec"]
command = data["command"]
shell = extension.preferences["shell"]

userShell = environ["SHELL"]
envUserShell = environ["SHELL"]


subprocess.run( [f'{terminal} {exec} {userShell} -c -i "{command}; {userShell}"'], shell=True )
if shell == "fish":
subprocess.run( [f'{terminal} {exec} {envUserShell} -c "{command}; {envUserShell}"'], shell=True )
else:
subprocess.run( [f'{terminal} {exec} {envUserShell} -c -i "{command}; {envUserShell}"'], shell=True )

return HideWindowAction()

Expand Down
10 changes: 10 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
"description": "The parameter your terminal uses to execute commands",
"default_value": "--"
},
{
"id": "shell",
"type": "select",
"name": "Shell",
"default_value": "others",
"options": [
{"text": "Bash / Zsh", "value": "others"},
{"text": "Fish", "value": "fish"}
]
},
{
"id": "icon",
"type": "select",
Expand Down

0 comments on commit d6bc215

Please sign in to comment.