Skip to content
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

Tide prompt variables orphaned after uninstall #69

Closed
PatrickF1 opened this issue Jan 6, 2021 · 13 comments
Closed

Tide prompt variables orphaned after uninstall #69

PatrickF1 opened this issue Jan 6, 2021 · 13 comments
Labels
🐛 bug Something isn't working

Comments

@PatrickF1
Copy link
Contributor

PatrickF1 commented Jan 6, 2021

Describe the bug

Steps to reproduce

  1. Fresh install tide: fisher install ilancosman/tide (after manually removing whatever universal variables were left behind)
  2. configure tide by hitting 1 1 1 1 1 .... y
  3. fisher remove ilancosman/tide
  4. Open new fish session
  5. Check universal variables
$ set | rg tide
_tide_left_prompt_display_77962 \e\[38\;2\;108\;108\;108m\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \…
_tide_right_prompt_display_77962 \e\(B\e\[m\e\(B\e\[m\e\(B\e\[m\ \e\(B\e\[m\e\[38\;2\;135\;13…

$ set -S _tide_left_prompt_display_77962
$_tide_left_prompt_display_77962: not set in local scope
$_tide_left_prompt_display_77962: not set in global scope
$_tide_left_prompt_display_77962: set in universal scope, unexported, with 0 elements
@PatrickF1 PatrickF1 added the 🐛 bug Something isn't working label Jan 6, 2021
@PatrickF1
Copy link
Contributor Author

Btw, I am not leaving tide, just experimenting with other prompts since there are so many good ones now.
Also, I was gonna fix it myself but then I realized it probably has to do with _tide_var_list and then I decided it's better left up to you to fix.

@IlanCosman
Copy link
Owner

Oh, yeah, that's really obvious in retrospect 😂

@PatrickF1
Copy link
Contributor Author

Happens to the best of us! What was so obvious about it?

@IlanCosman
Copy link
Owner

Well I never added them to _tide_var_list, so they won't get removed. I just had it so that on fish exit, they are erased. But if you uninstall, then that on_fish_exit function gets removed.

@IlanCosman
Copy link
Owner

I think it's unavoidable that we might orphan some variables since you can have multiple shells open. With async, _tide_left_prompt_display_$fish_pid might get set after you've uninstalled Tide in another shell. It's unfortunate, but not really a major issue if we leave a variable or two in this fairly uncommon case. Thanks for reporting this 😄

@IlanCosman
Copy link
Owner

Oh, actually, no we can have it taken care of! I just need to ensure that the _tide_on_fish_exit function isn't erased when uninstalling!

@PatrickF1
Copy link
Contributor Author

Nice work! You're welcome.

@jorgebucaran
Copy link
Contributor

Just erase functions last?

@PatrickF1
Copy link
Contributor Author

Wow we keep bumping into each other, Jorge!

@jorgebucaran
Copy link
Contributor

🏓

@IlanCosman
Copy link
Owner

Just erase functions last?

Tide already does this. The problem is that the universal variables may be set again afterwards by another shell for example. So we need something that has effect even after uninstalling Tide.

@IlanCosman IlanCosman changed the title Tide universal variables orphaned after uninstall Tide prompt variables orphaned after uninstall Jan 6, 2021
@kidonng
Copy link
Contributor

kidonng commented Jun 4, 2021

This also happens when you enter nested shells, and close the terminal tab containing the nested shells.

I think it's unavoidable that we might orphan some variables since you can have multiple shells open. ... It's unfortunate, but not really a major issue if we leave a variable or two in this fairly uncommon case. Thanks for reporting this 😄

Agreed, but still pretty annoying. Maybe someday I will write a function to check the variables list and remove the pids which aren't running.

@IlanCosman
Copy link
Owner

function to check the variables list and remove the pids which aren't running

That's a good idea! We could run it on interactive startup. I'll look into it for v5 😄

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants