Skip to content
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

connect terminal doesn't retain working directory like connect.kak #17

Closed
EpocSquadron opened this issue May 4, 2021 · 3 comments
Closed

Comments

@EpocSquadron
Copy link

With :new, I can open a split in my terminal (wezterm), and it has the same working directory as the terminal with Kakoune in it (meaning the directory the shell was in when I started up kakoune). I've also configured wezterm such that splits opened with it's own shortcuts also retain the working directory of the pane that was active when the shortcut was executed.

I recently was using connect.kak and :> would open a split and retain the working directly the same as the other two methods. A couple days ago I switched to kakoune.cr. Now when I use :>, the resulting split starts in my home directory instead. This affects things like running lf or skim from kakoune.cr, which I expect to run in the directory of the project I'm working on. What am I doing wrong?

@alexherbo2
Copy link
Owner

I cannot reproduce with Alacritty.

Try with terminal sh then pwd.

(You seem to confuse the server’s working directory and the terminal working directory. It’s natural in a client to be in the server’s working directory.)

It is possible your working directory is not honored but you don’t see it as you immediately attach a client.

Try with new then echo %val{client_env_PWD}.

@EpocSquadron
Copy link
Author

@alexherbo2 sorry about the imprecision. You were right about :new not being relevant here. I was able to reproduce with :terminal sh and :repl-new. I'm not sure how those are supposed to work, but looking at connect.kak versus the init/kakoune.kak in this repo, the former sent cd %sh{pwd} (after passing that through args anyway), which likely masked this issue. In this repo's version of the connect command, only session and client are passed. I assume : terminal is doing something to set the working directory in usual circumstances, but since I'm running wezterm I set the termcmd for it's wezterm cli split-pane command. I imagine I could send additional arguments in the termcmd to pass the working directory, but would that pick up changes to the session's working directory from things like :cd? Is there a more canonical approach?

@EpocSquadron
Copy link
Author

Turned out this was a bug in wezterm that has now been fixed. wez/wezterm#766 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants