You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fish doesn't notify gnome terminal / vte of current directory #906
Which does cause the next window to open in ~/dev/python, so it should just be a matter of adding something similar to fish when it's running under vte.
For reference, the script distributed with fedora adds these hooks if $VTE_VERSION is present and greater or equal to "3405".
Here's a workaround I've added to my own config.fish. The perl stuff is ugly, but I couldn't find a quicker way of urlencoding a string - perhaps there's already something built into fish that can do it?
if begin set -q VTE_VERSION; and test $VTE_VERSION -ge 3405; end
function __update_vte_cwd --on-variable PWD --description 'Notify VTE of change to $PWD'
status --is-command-substitution; and return
perl -MURI::Escape -MEnv -e 'print "\033]7;file://" . uri_escape($PWD, "^a-za-z0-9\-\._~\/") . "\a"'
end
end
The workaround, while works, it's also wrong (to implement in the shell itself, that is). I'm even going to ignore perl dependency - URI::Escape isn't core Perl module, so while it's possible (but I rather wouldn't) to add perl to dependencies (it's rather common), I wouldn't depend on modules that aren't in the core (see corelist).
I would rather see a solution that wouldn't run unneeded processes every time the path is changed, considering path changes are rather common. But, I'm not sure whatever it's even possible. At least, thanks for noting that it's easy to detect gnome-terminal's version (or rather, vte used by it) without external processes.
Yeah, I am assuming (hoping?) that fish internals have access to a URL encoding function somewhere - I wasn't actually suggesting adding perl as a dependency. This would also cut out the subprocess (assuming printf is implemented in-process).
It's checking for >= 0.34.5 (it uses -ge), isn't that correct if the change happened in vte 0.34.5? Or are you saying that the functionality was added in 0.34.5, and something else to do with bash changed in 0.34.5?
Oh, sorry, I was confused. 0.34.5 is fine (it happens). Also, yes, printf is a builtin. It would be nice if fish would have some builtin way of iterating in strings (something like ${a:0:1} in bash, or $a[1] in zsh), so it would be possible to do it inside fish.
Of course, there is always an option of making internal builtin, but... I'm not sure if I like it.
Activity
timbertson commentedon Jul 15, 2013
Here's a workaround I've added to my own config.fish. The perl stuff is ugly, but I couldn't find a quicker way of urlencoding a string - perhaps there's already something built into fish that can do it?
sugar700 commentedon Jul 18, 2013
The workaround, while works, it's also wrong (to implement in the shell itself, that is). I'm even going to ignore
perldependency -URI::Escapeisn't core Perl module, so while it's possible (but I rather wouldn't) to addperlto dependencies (it's rather common), I wouldn't depend on modules that aren't in the core (seecorelist).I would rather see a solution that wouldn't run unneeded processes every time the path is changed, considering path changes are rather common. But, I'm not sure whatever it's even possible. At least, thanks for noting that it's easy to detect
gnome-terminal's version (or rather, vte used by it) without external processes.timbertson commentedon Jul 18, 2013
Yeah, I am assuming (hoping?) that fish internals have access to a URL encoding function somewhere - I wasn't actually suggesting adding perl as a dependency. This would also cut out the subprocess (assuming
printfis implemented in-process).It's checking for >= 0.34.5 (it uses
-ge), isn't that correct if the change happened in vte 0.34.5? Or are you saying that the functionality was added in 0.34.5, and something else to do with bash changed in 0.34.5?sugar700 commentedon Jul 18, 2013
Oh, sorry, I was confused.
0.34.5is fine (it happens). Also, yes,printfis a builtin. It would be nice if fish would have some builtin way of iterating in strings (something like${a:0:1}in bash, or$a[1]in zsh), so it would be possible to do it inside fish.Of course, there is always an option of making internal builtin, but... I'm not sure if I like it.
Notify vte-based terminals of $PWD change (fish-shell#906)
Notify vte-based terminals of $PWD change (#906)
sugar700 commentedon Sep 4, 2013
Fixed by #973. Closing.
strelec commentedon Nov 17, 2014
Doesn't seem to work anymore.
ridiculousfish commentedon Nov 17, 2014
I filed #1814 to track the investigation. strelec, please share any information you have there.