You are not logged in.

#1 2013-05-03 06:58:00

stoolye
Member
Registered: 2013-04-29
Posts: 3

[SOLVED]gnome-terminal 3.8 and zsh: how to keep working directory?

Hi, all. I need some help.
As you may know, gnome-terminal 3.8 no longer remembers working directory when openning new tabs or new windows.
Some good guys in this thread suggested a workaround for bash.

. /etc/profile.d/vte.sh
export PS1='\[$(__vte_ps1)\]'$PS1

However, it does not work properly for zsh. I tried to export PS1 like this

export PS1='%{$(__vte_ps1)%}'$PS1

or

export PS1=$PS1'%{$(__vte_ps1)%}' # to avoid conflicting with printing last error code.

It would print a weird string for every prompt when working in directories start with ".", such as ".config".

Any workaround? Thank you very much.

UPDATE:
solution at #2

Last edited by stoolye (2013-05-06 03:26:13)

Offline

#2 2013-05-06 03:25:54

stoolye
Member
Registered: 2013-04-29
Posts: 3

Re: [SOLVED]gnome-terminal 3.8 and zsh: how to keep working directory?

I found the solution. Seems upstream has fixed it in git.
For now, we can put this line to .zshrc

chpwd_functions+=(__vte_ps1) # or replace __vte_ps1 with __vte_osc7 after updating vte to 0.34.5

[1]https://git.gnome.org/browse/vte/commit … c1c48c4c70

Last edited by stoolye (2013-05-06 03:26:50)

Offline

#3 2013-05-22 06:12:26

Avatar
Member
Registered: 2010-04-02
Posts: 31

Re: [SOLVED]gnome-terminal 3.8 and zsh: how to keep working directory?

Hi stoolye,

I'm having the same problem and I'd like to understand why your solution does not work for me.
So it looks like I have vte 0.34.5

So I put this in my .zshrc

 chpwd_functions+=(__vte_osc7) 

But that doesn't seem to have any effect.

Are chpwd_functions and the changes to PS1 supposed to be used together?
Any help would be appreciated.

Last edited by Avatar (2013-05-22 06:16:25)

Offline

#4 2013-07-11 14:53:14

crashandburn4
Member
Registered: 2013-03-03
Posts: 105

Re: [SOLVED]gnome-terminal 3.8 and zsh: how to keep working directory?

Avatar, did you ever manage to solve this as I have the same problem, neither

chpwd_functions+=(__vte_ps1)

nor

chpwd_functions+=(__vte_osc7)

added to my .zshrc have no effect, also how do I check the version of vte, it's not a command, mine says vte command not found if I try vte --version
the other vte I find appears to be a directory

Offline

#5 2013-07-11 15:49:09

crashandburn4
Member
Registered: 2013-03-03
Posts: 105

Re: [SOLVED]gnome-terminal 3.8 and zsh: how to keep working directory?

ahh, fixed the problem, it required setting my terminal to a login shell (see here for how to: http://rvm.io/integration/gnome-terminal)

Offline

Board footer

Powered by FluxBB