Skip to content

Commit

Permalink
Make bash as default shell on Linux (UsergeTeam#537)
Browse files Browse the repository at this point in the history
* Make bash as default shell on unix

* Forgot the walrus eyes ...
  • Loading branch information
Harsh-br0 authored and pull[bot] committed Feb 28, 2024
1 parent 276b319 commit c1b30ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions userge/plugins/builtin/executor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from contextlib import contextmanager
from enum import Enum
from getpass import getuser
from shutil import which
from typing import Awaitable, Any, Callable, Dict, Optional, Tuple, Iterable

import aiofiles
Expand Down Expand Up @@ -464,6 +465,8 @@ async def execute(cls, cmd: str) -> 'Term':
stderr=asyncio.subprocess.PIPE)
if setsid:
kwargs['preexec_fn'] = setsid
if sh := which(os.environ.get("USERGE_SHELL", "bash")):
kwargs['executable'] = sh
process = await asyncio.create_subprocess_shell(cmd, **kwargs)
t_obj = cls(process)
t_obj._start()
Expand Down

0 comments on commit c1b30ab

Please sign in to comment.