Skip to content

Notify vte of $PWD change - #973

Closed
timbertson wants to merge 2 commits into
fish-shell:masterfrom
timbertson:notify_vte_of_pwd
Closed

timbertson wants to merge 2 commits into
fish-shell:masterfrom
timbertson:notify_vte_of_pwd

Conversation

@timbertson

Copy link
Copy Markdown
Contributor

Fix fox #906.

@jephir

jephir commented Sep 4, 2013

Copy link
Copy Markdown

Thanks for creating this patch! It fixes the new tab issue on Fedora 19.

@sugar700

sugar700 commented Sep 4, 2013

Copy link
Copy Markdown
Contributor

Confirmed to work on gnome-terminal in Arch Linux (Cinnamon on Arch Linux is one of platforms I use, and lack of this feature annoys me). It feels like some sort of hax for me (mostly because of sed), but considering the alternative of not having this feature, it feels good enough. Merged with rebase, 8159f55..74e27a0.

@ridiculousfish

Copy link
Copy Markdown
Member

This isn't right:

if begin set -q VTE_VERSION; and test $VTE_VERSION -ge 3405; end

There's a missing semicolon after begin. That means that "set -q VTE_VERSION" are just parameters to begin, which are ignored. The rest of the command then gets broken in interesting ways.

This can be written more simply as:

if test "$VTE_VERSION" -ge 3405

which will do the right thing if VTE_VERSION is not set.

Also, pwd can be replaced with $PWD, which is faster (though probably lost in the noise from sed)

@ridiculousfish ridiculousfish reopened this Sep 4, 2013
@sugar700

sugar700 commented Sep 4, 2013

Copy link
Copy Markdown
Contributor

@ridiculousfish: Isn't pwd builtin?

Anyway, this is what I get for not testing it. I'm surprised that begin with something after it just worked, without any errors. That really should be a syntax error in my opinion, as begin doesn't take argument other than code block. It worked both on VTE and non-VTE terminals.

Edit: Actually, now that I check, it seems that begin doesn't require semicolon after it. I don't think it's a good style, but well...

@ridiculousfish

Copy link
Copy Markdown
Member

My mistake, pwd is builtin, so using it is fine.

Arguments to begin are indeed weird. I agree that it should be an error. I'll make a new issue.

Incidentally I'm not sure testing would have caught this. On systems without VTE_VERSION defined, the test command still fails as desired, but due to a parse error.

@timbertson

Copy link
Copy Markdown
Contributor Author

Sorry about that, and thanks for catching - I did test on a non-vte
terminal, but as you say it appeared to work (for the wrong reasons). I can
fix up the patch when I get near a proper computer, if someone else hasn't
already.

@ridiculousfish

Copy link
Copy Markdown
Member

Looks like GlitchMr fixed this as fe10f98
Thanks GlitchMr!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants