还原集成的终端会话,其中最后一个工作目录在git bash上
通常当我们退出终端并重新打开它时,它会恢复我们的终端和选项卡,这是一个很好的功能,但是它也可以恢复我们最后的cwd吗?我认为应该可以,但我无法让它在我的终端上运行。
它说会话内容恢复
之前的目录是.../shop/shop-next
,但恢复后只是。 ../shop
我希望它是相同的与之前一样 (.../shop/shop-next
) 恢复后
相关设置为:
在设置“持久会话恢复过程”时,它说它应该恢复CWD 取决于它是否受支持终端
我不知道 git bash 是否支持此功能,所以这是我的问题:
- 有没有办法完成它?(不使用扩展)
- 什么终端/配置文件/bash 支持此功能。
usually when we exit the terminal and re open it, it will restore our terminal and tabs, its good a feature, but can it restore our last cwd too? i think it supposed to, but i cant get it working on my terminal.
the session doesnt save my last working directory
it said session contents restored
the directory before that is .../shop/shop-next
, but after restored its just .../shop
i want it to be the same as before (.../shop/shop-next
) after restored
the setting related is :
on setting "persistent session revive process", it said that it supposed to restore the CWD depends on whether it supported by the terminal
i dont know if git bash is support this feature, so here is my question:
- is there a way to get it done?(without using extension)
- what terminal/profile/bash support this feature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(对不起,当您使用标签时,这可能对您不起作用,但可能会带给您一些想法。)
我使用了一些技巧,我正在将更改目录的路径写入文件,并且在会话负载上使用了此保存的路径。
因此,如果我们谈论Windows(或类似于Mingw64)或 *Nix Systems的Git Bash,我在.bashrc文件中使用了此代码:
您可以更改此行:
default_dir =〜
in First on打开它总是会将您返回到最后一个目录位置。
(Sorry, this might not work for you, as you use tabs, but probably would bring you some ideas to improve.)
I used some trick, I was writing path of changed directory into a file, and used this saved path on session load.
So, if we are talking about Git Bash for Windows (or any similar to MINGW64) or *nix systems, I used this code in .bashrc file:
You may change this line:
DEFAULT_DIR=~
On first open it always would return you to last directory location.