Fix a regression in the previous release that broke use of the cd command in session files

Fixes #7829
This commit is contained in:
Kovid Goyal
2024-09-06 14:50:15 +05:30
parent bfbffc3a7b
commit b479089619
2 changed files with 6 additions and 1 deletions

View File

@@ -74,6 +74,11 @@ consumption to do the same tasks.
Detailed list of changes Detailed list of changes
------------------------------------- -------------------------------------
0.36.3 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Fix a regression in the previous release that broke use of the ``cd`` command in session files (:iss:`7829`)
0.36.2 [2024-09-06] 0.36.2 [2024-09-06]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -103,7 +103,7 @@ class Session:
def add_window(self, cmd: Union[None, str, list[str]], expand: Callable[[str], str] = lambda x: x) -> None: def add_window(self, cmd: Union[None, str, list[str]], expand: Callable[[str], str] = lambda x: x) -> None:
from .launch import parse_launch_args from .launch import parse_launch_args
needs_expandvars = False needs_expandvars = False
if isinstance(cmd, str): if isinstance(cmd, str) and cmd:
needs_expandvars = True needs_expandvars = True
cmd = list(shlex_split(cmd)) cmd = list(shlex_split(cmd))
spec = parse_launch_args(cmd) spec = parse_launch_args(cmd)