zellij icon indicating copy to clipboard operation
zellij copied to clipboard

CWD never changes when reattaching back to an exited session

Open Nukiloco opened this issue 1 year ago • 6 comments

Basic information zellij --version: zellij 0.39.0 stty size: 28 72

uname -av or ver(Windows): Linux domu 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Further information Update: I now got it down to just doing these steps below. So I updated all the information below and removed all the unneeded information.

It seems like creating it for the first time will allow cwd to be changed by cd. However, by doing these following steps, you can get cwd to not change its directory at all.

Here are the steps to reproduce it:

  1. zellij attach --create any_session_name
  2. Exit from that session.
  3. zellij attach --create session_name_that_you_exited_from
  4. Use the cd command to change to a different directory in a tab
  5. Exit from that session.
  6. zellij attach --create session_name_that_you_exited_from
  7. You will notice that the current working directory has not changed.

Nukiloco avatar Dec 03 '23 06:12 Nukiloco

I fixed the script though the issue still happens. What's annoying is that the tab bar and the status bar has completely disappeared now. Which makes this hard to debug. For some odd reason, navigating to a certain tab will sometimes wipe everything in that tab which causes the status bar and tab bar to appear. Though this seems like a separate issue from what im having.

Actually now testing this further, it seems like its happening to all sessions now?

layout {
    cwd "/home/nukiloco/dotfiles"
    tab name="Tab #1" hide_floating_panes=true {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        pane cwd="/home/nukiloco/dotfiles" focus=true
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }
    tab name="Tab #2" hide_floating_panes=true {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        pane cwd="/home/nukiloco/dotfiles" focus=true
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }
    tab name="home dir" hide_floating_panes=true {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        pane cwd="/home/nukiloco/dotfiles" focus=true
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }
    tab name="Tab #4" focus=true hide_floating_panes=true {
    }
    new_tab_template {
        pane size=1 borderless=true {
            plugin location="zellij:tab-bar"
        }
        pane cwd="/home/nukiloco/dotfiles"
        pane size=2 borderless=true {
            plugin location="zellij:status-bar"
        }
    }
}

Nukiloco avatar Dec 03 '23 11:12 Nukiloco

The plugins disappearing look like they are happening to all sessions i use zellij attach --create SESSION_NAME. Zellij not changing its directory seems like its happening on all sessions now though these are just by running zellij, then resurrecting them. I have not used my own script at this point now.

Nukiloco avatar Dec 03 '23 11:12 Nukiloco

So it looks like I can change the cd on a new session, however if I quit from it, and then attach back to it, changing the directory will no longer save. These new sessions that im creating just from running zellij are not using symlinks.

Nukiloco avatar Dec 03 '23 11:12 Nukiloco

I changed the title of this to more reflect of whats currently happening. I guess I will make another bug report about the tab information being randomly wiped for no reason?

Nukiloco avatar Dec 05 '23 06:12 Nukiloco

Happens on zellij 0.39.2

towry avatar Dec 05 '23 09:12 towry

I can reproduce this on version 0.40.0 as well.

plotnw avatar Apr 16 '24 18:04 plotnw

It's happening to me on 0.40.1

jelenv avatar Jul 12 '24 08:07 jelenv