tabby icon indicating copy to clipboard operation
tabby copied to clipboard

After restoring tabs on app reopening, the working directory gets reset to the default one (instead of the "saved" one)

Open kostia1st opened this issue 2 years ago • 14 comments

Version: 1.0.148 Platform: win32 10.0.19043 Plugins: none

kostia1st avatar Jul 23 '21 19:07 kostia1st

The real history of commands is not preserved either, it has some history though, but definitely not from that tab

kostia1st avatar Jul 23 '21 19:07 kostia1st

Steps to reproduce:

  • make sure the app is set up to restore the tabs
  • open the app
  • open a tab
  • navigate to some other folder (cd ./something)
  • close the whole app
  • open the app again
  • the tab is restored, but the working folder is not the one you were in when closing the window

kostia1st avatar Jul 23 '21 19:07 kostia1st

Which shell are you using?

Eugeny avatar Jul 23 '21 21:07 Eugeny

Oh, sorry, forgot to mentiono. It's git bash, one of the latest I suppose.

kostia1st avatar Jul 23 '21 21:07 kostia1st

Does the "copy current path" item in the context menu copy the correct path?

Eugeny avatar Jul 24 '21 07:07 Eugeny

There's a floating message on an attempt to copy that path Shell does not support current path detection

kostia1st avatar Jul 24 '21 11:07 kostia1st

I'm also facing the same issue as @estorski although my working path are restored properly but not the history commands for respective tabs.

Also the copy current path resulted in Shell does not support current path detection

Version: 1.0.148 Platform: win32 10.0.19042 Plugins:

  • community-color-schemes
  • core
  • electron
  • local
  • plugin-manager
  • serial
  • settings
  • ssh
  • telnet
  • terminal

hueyyeng avatar Aug 06 '21 13:08 hueyyeng

@estorski I am facing the same issue. I am using the latest version (Alpha 158) on Mac 10.14.6 with all default settings and no additional plugins.

@Eugeny when I cd to a folder I right-click in Tabby and select "Copy current path" it does not work as expected: expected: /Users/myusername/subfolder actual: /Users/myusername

I only downloaded this app so I could use this feature and save my terminal windows so when I restart my laptop they are all still there. Will probably go back to terminal for now.

ianwieds avatar Oct 02 '21 02:10 ianwieds

Having the same problem, for me however, path reporting does work since I've added the following line in my .zshrc as per instructions in an older GH issue.

# Report shell paths to Tabby
precmd () { echo -n "\x1b]1337;CurrentDir=$(pwd)\x07" }

On Tabby restart, previous directory is visible for a short time, as well as the "History Restored" marker, then the buffer is erased and I find myself in the default home directory with no history.

Windows 10, WSL2, Tabby 1.0.161 with ZSH 5.8 and Oh-My-ZSH master@2e46b2a2

nicbet avatar Oct 29 '21 14:10 nicbet

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks unless you comment. Thank you for your contributions.

stale[bot] avatar Apr 27 '22 19:04 stale[bot]

I have to change directory manually in all my tabs every day (or after restarting Tabby). Current version is 1.0.181.

KolbeinFoldoy avatar Jun 20 '22 13:06 KolbeinFoldoy

It's been a year already since my last comment and I'm still facing this issue for both personal and also work PC even with Alpha 183.

I'm curious for those that works, what's their Windows and Tabby config looks like. This impacts Git Bash and WSL2 Ubuntu. Haven't tried other shell but I figure it should be the same.

hueyyeng avatar Aug 12 '22 14:08 hueyyeng

Unfortunately Tabby doesn't support natively detecting and setting CWD for all shells yet - see here for exact details: https://github.com/Eugeny/tabby/issues/5467#issuecomment-1025190892

A 100% reliable workaround for this is to manually set up CWD reporting as described in the https://github.com/Eugeny/tabby/issues/4259#issuecomment-954777938 above - I'll also appreciate any help adding missing support for shells mentioned in the table.

Eugeny avatar Aug 12 '22 14:08 Eugeny

Unfortunately Tabby doesn't support natively detecting and setting CWD for all shells yet - see here for exact details: #5467 (comment)

A 100% reliable workaround for this is to manually set up CWD reporting as described in the #4259 (comment) above - I'll also appreciate any help adding missing support for shells mentioned in the table.

Thanks for the prompt reply. I added the precmd () { echo -n "\x1b]1337;CurrentDir=$(pwd)\x07" } to .bashrc for Git Bash for WIndows and both .bashrc and .zshrc for WSL2 Ubuntu. Got interesting results for each of them.

Git Bash for Windows

It works and will restore the last known working directory.

WSL2 Ubuntu using oh-my-zsh

Unexpected result where it now default to /mnt/c/Users/<username>/AppData/Local/Programs/Tabby instead.

hueyyeng avatar Aug 12 '22 14:08 hueyyeng