-
Notifications
You must be signed in to change notification settings - Fork 6
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
Restoring workspace into current window #70
Comments
You should be able to restore within your current window by passing in the following as opts: resurrect.window_state.restore_window(pane:window(), state, {
relative = true,
restore_text = true,
on_pane_restore = resurrect.tab_state.default_on_pane_restore,
-- the following line should use active tab when restoring
tab = win:active_tab(),
}) |
Im having the same issue. setting
had no effect, the workspace still opened in a new window. I've also tried:
This works, but the first tab always reset it's CWD. Like if I had NVIM open to .dotfiles in that tab, it will still have nvim open, but the CWD will my default cwd. Any solution? |
@travisjbeck have you configure OSC 7 integration with Wezterm? This might be why the new tab is not opening in the expected directory. See Wezterm docs - Shell Integration. |
I just set this up by copying the shell integration script and sourcing it at the end of my .zshrc, and with the same config mentioned above my cwd in the first tab of my saved workspace is still getting set to the default. Not sure how to troubleshoot this on my end |
Strange, what platform are you on? Mac, Windows using a local domain? Windows using WSL-domain? Linux? Unix socket? Also have you tried updating the plugin? You can do so with the documentation which is described here |
Thanks for the quick response! This is on Mac using a local domain. The plugin is up to date but no luck 😕 |
Thanks for a very useful plugin @MLFlexer . I'd like to add to this thread by mentioning that the new workspace takes on whatever directory the window/pane/tab was in, when you resurrect the workspace. I am currently also trying to configure this behaviour as my own preference as well, i.e. resurrect the CWD that was saved with the workspace originally. I'm on MacOS. |
I did not have that initially, but after adding it, the first tab still loses the CWD. I'm on Mac 15.1.1 I also updated the plugin. |
Thanks for the kind words!
And thank you for looking into this, I don't really use this feature myself, so it is great to have information like this. I will try and work on this in the following days, my life has been really busy lately, so I havn't had much time to work on it 😄 |
Thanks for keeping me updated, I think I have an idea of a fix, and will work on this in the following days |
Update the plugin and checkout the new readme section if you want to be able to restore into the current window 😄 Also please report all bugs you find related to this, as I am not myself a user of this feature, so I don't know if there are bugs |
Thanks for the update. Unfortunately, I still have the same issue with the first tab. I tried what you had in the readme, but my config is workspace based, i believe. My dotfiles are here if you want to take a look at my configuration. |
I can only view the commit from 1 month ago, can you paste your Also just to make sure, you have updated the plugin and updated the config with the following opts? local opts = {
close_open_tabs = true, -- **THIS IS THE NEW OPTION**
window = pane:window(), -- **THIS IS ALSO NEEDED**
on_pane_restore = resurrect.tab_state.default_on_pane_restore,
relative = true,
restore_text = true,
} And made sure that the |
Here is my config file. My repo is up to date as well now.
|
It should work fine when restoring the windows, but you also mention that your config is workspace based so that might be where I'm missing something. 😄 Can you walk me through how you use it and what you would like/expect as an outcome? Would you like to resurrect a workspace when you switch to it? If so, then it might be related to this |
Really appreciate the time your putting in to helping us figure this out. I say "workspace based" but I could be describing it incorrectly. Here is the scenario: My workflow is to have 2-3 tabs open with different nvim projects and a tab or so of command lines for those projects. I have a default workspace name defined in wezterm's config. When I go to load the session, I choose the top most option named after my default workspace. Im not really switching workspaces, just want to restore the previous state. This currently works perfectly except for the first tab's cwd, nvim will be running and even still has it's buffers, but the underlying working directory is always " ~/". All other tabs are exactly how I want them. I'm only using tabs and not splits or multiple windows. |
This comment might be helpful. #73 (comment) The config that I'm using does the following,
The options Credits to @strobe for sharing the snippet for creating the temporary workspace. |
Is it possible to restore the workspace into the current window instead of opening a separate window?
It would be nice to open a workspace as a workspace accessible in the workspace list in Wezterm. This would keep the rest of the workspaces available as well.
The text was updated successfully, but these errors were encountered: