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

[BUG]: Creating a new terminal across the day cleans the temporary directory, causing the directory link in use to be deleted #283

Closed
jan-bar opened this issue May 21, 2024 · 6 comments · Fixed by #284
Labels
bug Something isn't working
Milestone

Comments

@jan-bar
Copy link
Contributor

jan-bar commented May 21, 2024

Version
0.5.3
OS
Windows

Describe the bug
1716134400 -> 2024-05-20 00:00:001716220800 -> 2024-05-21 00:00:00

The terminal created on 2024-05-20 never exits

Create a new terminal on 2024-05-21 to trigger the temporary directory cleanup logic

Then the temporary directory used by the terminal created on 2024-05-20 was deleted, and the temporary directory of 2024-05-21 was generated. However, the terminal did not switch to the new temporary directory, and the corresponding temporary directory was not created directory link

image

@jan-bar jan-bar added the bug Something isn't working label May 21, 2024
@aooohan
Copy link
Member

aooohan commented May 21, 2024

The terminal created on 2024-05-20 never exits

This situation was never considered from the beginning. : |

If we want to solve this issue, we have to see if the process is still alive as you suggested before we clean up.

#280 (comment)

@jan-bar
Copy link
Contributor Author

jan-bar commented May 21, 2024

If we want to solve this issue, we have to see if the process is still alive as you suggested before we clean up.

This solution needs to support cross-platform detection of whether the pid is running, which is not easy to implement.

According to the above situation, when the terminal executes vfox env -s xxx , a new temporary directory will be created, but the relevant directory link is missing in the directory. And the environment variables are not updated to the new temporary directory.

Add cross-day detection to the vfox env -s xxx command. When a cross-day occurs, a new temporary directory will be generated and new environment variables will take effect. What about this solution?

It is worth mentioning that fnm: Schniz/fnm#696 has not yet completed cleaning up the history files.

@jan-bar
Copy link
Contributor Author

jan-bar commented May 21, 2024

If we want to solve this issue, we have to see if the process is still alive as you suggested before we clean up.

This library can find the currently running process:https://github.com/mitchellh/go-ps

@ZuBB
Copy link

ZuBB commented Sep 29, 2024

hey guys,

Is it possible that this issue still exists somehow/partially? today I faced a case when npm suddenly became unavailable (kitty+tmux+fish). I created a new tab in tmux, and there npm/node was present. then I back to the previous tab and npm here resurrected.

image

@jan-bar
Copy link
Contributor Author

jan-bar commented Sep 30, 2024

@ZuBB

Run which node to see which directory the node is in. It may be in: https://vfox.lhan.me/usage/shims-path.html

@ZuBB
Copy link

ZuBB commented Oct 4, 2024

I just got this one more time

image

switching to existing tmux panes (shell sessions) did not change anything. but creating a new pane helped. and node in /Users/vv/.version-fox/temp/1727128800-4412/ folder has been resurrected

image

ps: can a suspend process influence this somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants