-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow opening new tab in CWD, but without the ssh kitten #5672
Comments
map f1 launch --cwd=oldest https://sw.kovidgoyal.net/kitty/launch/#cmdoption-launch-cwd |
Ah, thanks for that! Hadn't noticed there was such a flexible option available. However this does not work for me, as it looks like the The following patch fixes the issue for me and allows diff --git a/kitty/window.py b/kitty/window.py
index 1532a09d..5e6e94c6 100644
--- a/kitty/window.py
+++ b/kitty/window.py
@@ -99,7 +99,7 @@ def modify_argv_for_launch_with_cwd(self, argv: List[str]) -> str:
if not window:
return ''
reported_cwd = path_from_osc7_url(window.screen.last_reported_cwd) if window.screen.last_reported_cwd else ''
- if reported_cwd:
+ if reported_cwd and self.request_type is CwdRequestType.current:
# First check if we are running ssh kitten, and trying to open the configured login shell
if argv[0] == resolved_shell(get_options())[0]:
ssh_kitten_cmdline = window.ssh_kitten_cmdline() Should I create a PR or a separate issue for this? |
Actually thinking about it, this wont work as the foreground process For your use case you will need a new special keyword for --cwd say |
Thank you.
|
Is your feature request related to a problem? Please describe.
I just tried the ssh kitten, and it just works wonderfully!
My only gripe is that I need to be able to:
Describe the solution you'd like
Anything that allows me to specify whether I want the local or remote CWD is fine by me.
Describe alternatives you've considered
new_[tab|window]_with_cwd
implicitely usingcwd
as meaning "current remote directory" is a bit weird, but understandable. Either having more explicit directives (new_tab_with_remote_cwd
/new_tab_with_local_cwd
) or an argumentnew_tab_with_cwd local
sounds great.In the meantime I've been using
new_tab
, but this means I have tocd
back to my local directory every time I create a new tab/window.Additional context
If you tell me what syntax you want, I'd be happy to write a PR for it. Looks like it's as simple as giving a flag to
.window.CwdRequest
's constructor and using it inCwdRequest.modify_argv_for_launch_with_cwd
?The text was updated successfully, but these errors were encountered: