Save tabs when directory changed, not on_terminal_title_changed (#1633) - #1786
Conversation
This should fix #1633. This commit remove `@save_tabs_when_changed` on `on_terminal_title_changed`, and put the terminal directory into ther instance. This is because `vte:current-directory-uri-changed` is not worked, and `current-directory-uri` always return `None`. When `on_terminal_title_changed` called, it will check if the directory changed for this terminal, if so, then save the tabs by the setting.
|
This may not work for split window... |
There was a problem hiding this comment.
I'm somewhat dubious of the overall approach here. It seems to rest on the confusion that VTE titles are a representation of the CWD (current working directory). They aren't.
It just so happens that bash on many systems by default sends [{{cwd}}] as the VTE title, and many people don't customize that, neither interact with other programs which set VTE titles too. Still many other people do do that, and those will see why this PR misses the point.
So instead of adding more logic entrenching the confusion — some logic needs to be removed. Specifically, as the original issue reporter said:
there is no reason to save the "label" unless when "custom_label_set": true. It will anyway not be used when restoring the tabs.
Please follow this. When a program sends to Guake please name my tab "IAmFoobar" — there's no slightest need to persist "IAmFoobar" anywhere; the program will send it again. When the user however names a tab "MyAwesomeSpecialTab" — we want to ignore what the programs send, and we want to save this manual label into session.json and restore it when restarted.
This PR didn't use VTE titles as their CWD, here we only use
I've test with default bash shell, and Or are there any cases that
Again, this PR only use
|
This should fix #1633.
This commit remove
@save_tabs_when_changedonon_terminal_title_changed,and put the terminal directory into ther instance. This is because
vte:current-directory-uri-changedis not worked, andcurrent-directory-urialways return
None.When
on_terminal_title_changedcalled, it will check if the directorychanged for this terminal, if so, then save the tabs by the setting.