1

I just got upgraded to Red Hat 7 and am getting used to the changes. One thing I immediately noticed was that when I press Ctrl-Shift-T to open a new terminal tab, it defaults to / rather than the current directory, which is very frustrating.

I am using gnome terminal 3.8.4. I found what looks like the same issue in Ubuntu with a suggested .bashrc fix, but my organization uses tcsh and adding that line does not work.

Is this a known issue in RH7? How can I fix it?

1

Basically you'll have to port vte.sh to tcsh. What it does is: before each prompt, it prints a certain escape sequence that contains the directory, in URI-encoded form. The escape sequence is the so-called OSC 7, e.g. \e]7;file:///home/username\a.

It seems tcsh does have a precmd (and even a cwdcmd) feature so it can be done, but unfortunately I'm not familiar with tcsh at all to quickly do it for you. I hope that you can do it for yourself with this bit of help.

Edit: The complicated part is URL-encoding. For start, you can omit this and simply echo \e]7;file://$PWD\a. It will work incorrectly for a few special characters you might probably never hit.

Edit: This one works for me as the simple (not properly URI-escaping) version:

alias precmd 'echo -n "\e]7;file://$PWD\a"'
  • Thanks for the explanation! This is working for me, I haven't run into special characters yet but will update if I do. – user812786 Oct 19 '15 at 13:22
  • '%' is definitely such a special characters; so are '\a' (which is extremely unlikely to occur in a filename) and perhaps '\n' and friends (which are also unlikely). I'm really unsure about accented letters. In practice, you'll probably be just happy with the current solution and even if you encounter one of these characters then it's simpler to go on without changing the code and just accepting this little breakage :) (For a mainstream solution included in vte we'd need to figure it out properly.) – egmont Oct 19 '15 at 22:37
  • 1
    I've added us a (really low priority) reminder: bugzilla.gnome.org/show_bug.cgi?id=756830. I can't guarantee we'll address it in the foreseeable future. – egmont Oct 19 '15 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.