mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 08:18:08 +02:00
Allow using the cwd of the oldest as well as the newest foreground process for launch --cwd
This commit is contained in:
@@ -67,7 +67,10 @@ to the newly opened window.
|
||||
The working directory for the newly launched child. Use the special value
|
||||
:code:`current` to use the working directory of the currently active window.
|
||||
The special value :code:`last_reported` uses the last working directory
|
||||
reported by the shell (needs :ref:`shell_integration` to work).
|
||||
reported by the shell (needs :ref:`shell_integration` to work). The special
|
||||
value :code:`oldest` works like :code:`current` but uses the working directory
|
||||
of the oldest foreground process associated with the currently active window
|
||||
rather than the newest foreground process.
|
||||
|
||||
|
||||
--env
|
||||
@@ -382,6 +385,8 @@ def launch(
|
||||
elif opts.cwd == 'last_reported':
|
||||
if active:
|
||||
kw['cwd_from'] = CwdRequest(active, CwdRequestType.last_reported)
|
||||
elif opts.cwd == 'oldest':
|
||||
kw['cwd_from'] = CwdRequest(active, CwdRequestType.last_reported)
|
||||
else:
|
||||
kw['cwd'] = opts.cwd
|
||||
if opts.location != 'default':
|
||||
|
||||
Reference in New Issue
Block a user