Skip to content

Commit

Permalink
Set default shell on Windows to "powershell" (AcademySoftwareFoundati…
Browse files Browse the repository at this point in the history
…on#1578)

Signed-off-by: Jean-Christophe Morin <[email protected]>
Signed-off-by: Jose Enriquez <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso authored and Jose Enriquez committed Feb 14, 2024
1 parent f82383f commit a0ec28d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/rez/rezconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@
# The default shell type to use when creating resolved environments (eg when using
# :ref:`rez-env`, or calling :meth:`.ResolvedContext.execute_shell`). If empty or None, the
# current shell is used (for eg, "bash").
#
# .. versionchanged:: 3.0.0
# The default value on Windows was changed to "powershell".
default_shell = ""

# The command to use to launch a new Rez environment in a separate terminal (this
Expand Down
5 changes: 3 additions & 2 deletions src/rez/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ def shell(self):
"""Get the current shell.
Returns:
The current shell this process is running in (bash, tcsh, pwsh, etc).
The current shell this process is running in (bash, tcsh, pwsh, etc). On Windows,
the return value is always "powershell".
"""
from rez.shells import get_shell_types
shells = set(get_shell_types())
if not shells:
raise RezSystemError("no shells available")

if self.platform == "windows":
return "cmd"
return "powershell"
else:
import subprocess as sp
shell = None
Expand Down

0 comments on commit a0ec28d

Please sign in to comment.