-
What Operating System(s) are you running on?macOS Which Wayland compositor or X11 Window manager(s) are you using?No response WezTerm version20240203-110809-5046fc22 Ask your question!I have spent way too much time trying to get this to work, so finally reaching out for help. When i exit nvim I want the wezterm window nvim was in to be at the current working directory. I have been successful with integrating wezterm and the shell (zsh) using the .wezterm_shell_integration.sh . I also set it up in nvim to send OSC 7 escape sequences to wezterm everytime CWD is changed within neoVim and this is working. This is confirmed both by showing the changed CWD in the status bar and i am also able to open new tabs/panes to that CWD even when changed in neoVim. The issue I am having is that when i exit nvim, I would like the tab/pane that nvim was in to exit to the CWD. I would have thought i could do so using the "set-working-directory" command on nvim exit, but I can't get it to work. So what happens is that on nvim close the prompt is at the original directory of when that wezterm window was opened even though that is no longer the CWD. Even if i CD to a new directory, it doesn't change the CWD which is reflected both in the status bar which shows the CWD from where i was in neoVim and also if I open a new pane, that pane will be in the CWD from when neoVim exited, and if I CD to a new directory from that new pane then the CWD will change, again reflected both in the status bar and if I then open additional panes. I have even tried using barebones testing .zshrc and wezterm.lua files with just enough to have the shell integration and ability to receive the OSC 7 escape sequences just to see if i was having conflict issues with any other of my configurations, but still the same issue. Thaniks in advance for any help. My ADHD hyper focus kicked in yesterday and i lost countless hours trying to ge this to work when i should have just been coding the project i was supposed to be working on. hahah |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi allreddv, Unfortunately, this is not directly possible. Wezterm can not alter the execution environment of an already running process. You would have to configure your shell to change the cwd itself, which is possible with some gymnastics, but depends on which shell you're using, and how much tomfoolery you're willing to tolerate ;-) |
Beta Was this translation helpful? Give feedback.
If it works for you, that's all that matters! One thing to check, is if it disrupts your command history. That'll depend on how you have zsh configured, and what you're used to.