Open amiorin opened 4 months ago
It's funny, I totally forgot about OSC 7 and implemented various workarounds to this over time. Will definitely implement support for it soon.
Otherwise though - could you explain what you mean? Do you mean that when you open new panes they should be in the same cwd as the original emacs pane? Because this should work already (minus a couple of issues I hope to fix before the next release).
It doesn't work as expected because the cwd
of emacs
and emacsclient
in osx (checked with lsof -d cwd
) doesn't change when switching between projects inside emacs
. Therefore vterm
(the terminal inside emacs
) and zellij new-pane
have different cwd
. The script above asks emacs
what is the root of the current project so that vterm
, zellij
, and wezterm
use the same cwd
.
The other thing we would love to see is https://github.com/christoomey/vim-tmux-navigator for zellij. I can open other ticket if needed where I can go in the details.
So just to get it straight: we're talking about opening a terminal and having its cwd start as the cwd of emacs (assuming it is focused), right? This should be fixed by implementing OSC 7 - I hope to get to it before next release, but I can't promise.
I think someone did a version of this plugin somewhere... either way, it can be done with plugins today but not in a very robust manner. In a couple of versions it'll be easier with some new action interrupt APIs.
The debate in my team is if it is better to run the terminal inside
emacs
or not. One feature of runningvterm
inside emacs is that the working directory is following the root of the current project opened inemacs
. After some thinking we decided to try to solve the problem from the init script offish
.I'm sharing the
fish
code here. Maybe it will be useful to otherzellij
users. It can be adapted to other shells andneovim
.We still think that
emacs
and the shell should communicate theCWD
tozellij
using OSC 7. See #898 and #892. Maybezellij
should not forward theOSC 7
but it should capture it and use it.