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
"Inherit" working directory when creating a new terminal #34
Comments
👍 |
It does for me under bash and that is definitely the intent. What shell are you guys using? |
I'm using bash too but it does not work here (using the latest version on Arch) |
I'm using bash with Arch latest. Just confirmed every new terminal goes back to home, be it on a split, new window or new session. |
Can you post your .bashrc when you get a chance please |
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
export LANG=fr_BE.UTF-8
export LC_MESSAGES="C"
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
#Powerline configurations
if [ -f /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/lib/python3.5/site-packages/powerline/bindings/bash/powerline.sh
fi
# Thefuck configurations
eval "$(thefuck --alias)"
eval "$(thefuck --alias FUCK)" |
I'd just like to mention that gnome-terminal presents the correct behavior, if that is worth noting. There it goes:
|
Thanks for the .bashrc, I see the problem. On my system before terminix was even a glimmer in my eye I noticed that gnome-terminal wasn't creating tabs in the same directory as the current tab anymore. After looking around, I found the solution was to add the following to my .bashrc: . /etc/profile.d/vte.sh Once I added this to your bash files the feature started working. I need to do some investigation and see what it would take to get this working without this hack because I'm finding without this VTE no longer returns a directory when I call vte_terminal_get_current_directory_uri and I'm relying on this in a couple of places. |
Here's a link to the issue where I got this from: http://unix.stackexchange.com/questions/93476/gnome-terminal-keep-track-of-directory-in-new-tab |
OK after looking at this for awhile I came across this bug report: https://bugzilla.gnome.org/show_bug.cgi?id=697475 I'll give you the TL;DR; version, apparently the VTE widget which gnome-terminal uses (and a bunch of other terminal emulators including terminix) switched from reading directory information from /proc to getting it via /etc/profile.d/vte.sh settinng a PROMPT_COMMAND to emit a terminal control code. Apparently there were a bunch of issues with the /proc methodology and using vte.sh was more reliable. On Fedora, /etc/profile.d is used by both login and non-login shells so it works fine there, however on other distributions, such as Ubuntu and apparently Arch, this is only for login shells. So there are really two possibilities here to fix this issue, either include /etc/profile.d/vte.sh in .bashrc or in your profile set the option to use a login shell in the Command tab. Note that using a login shell currently seems broken for me in terminix, I'll put out a release tonite to fix it. Finally, I could potentially write some code to fallback to reading /proc myself in terminix if I don't get the current directory from VTE, which indicates this problem. However I'm reluctant to do so based on the comments of VTE upstream developers since they have more experience in this area and if they have been having issues with it I doubt I will magically do a better job. Instead, what I propose for a fix is to show a message dialog warning of this issue along with the information about how to fix it, maybe a link to a FAQ wiki page in github. Does this seem reasonable? |
Closed this in a commit accidentally. I've "fixed" the issue by adding a notification to the user. Could you guys do me a favor and test it before I cut a release. I've tested it on Arch, RHEL 7.2 and Ubuntu 16.04 and it seems to behave as expected but I'd appreciate a double check. You can download the debug release archive http://www.gexperts.com/files/terminix.zip. Note that you will need to unzip it into your / as per normal release instructions since the glib schema changed to support a new preference. Unzipping is done as follows:
|
Yeah of course! I guess you have not pasted the right link as the page is not found :p |
Updated the link, thanks. |
Thanks, though your second screenshot is making me double check something. You should only get the dialog when the problem is there, i.e. splitting the terminal should not preserve the directory. However in your second screenshot it looks like you split the terminal and it preserved the directory which is why I'm questioning this? Did you get the dialog, fixed the issue and then split it to show me that the suggested fix works? |
@gnunn1 I got the dialog before activating "Run command as a login shell". sorry i didn't mention that |
No worries, thanks for the quick response. I'll roll out a new release in an hour or so. |
I have sourced
And
Any ideas? More info it that helps
|
Thanks God. It took me a few months before finding this solution. I feel like having a tumor removed. |
Sorry Folks, |
Is it possible to make newly created terminals (spit, new session, new window) to inherit the working directory of the terminals they were "created from" (i.e. focused when they were created)?
The text was updated successfully, but these errors were encountered: