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]: Cross day terminal needs to continue to use existing temporary directory #313

Closed
jan-bar opened this issue Jun 25, 2024 · 0 comments · Fixed by #314
Closed

[BUG]: Cross day terminal needs to continue to use existing temporary directory #313

jan-bar opened this issue Jun 25, 2024 · 0 comments · Fixed by #314
Labels
bug Something isn't working
Milestone

Comments

@jan-bar
Copy link
Contributor

jan-bar commented Jun 25, 2024

Version
0.5.3
OS
Windows

Describe the bug
I have a PID = 30804 terminal, and the terminal has never been closed,When I enter the command at the terminal the next day, a new temporary directory will be generated,As shown in the figure below, two temporary directory will be generated

image

But the environment variable of the terminal is still the earliest temporary directory

image

The issue I fixed by retaining old temporary directories across days does not solve the current problem
#283

As shown in the figure below, curTmpPath should not be generated every day, and the effective temporary directory should be reused

vfox/internal/path.go

Lines 56 to 65 in d3d731c

pid := env.GetPid()
timestamp := util.GetBeginOfToday()
name := fmt.Sprintf("%d-%d", timestamp, pid)
curTmpPath := filepath.Join(tmpPath, name)
if !util.FileExists(curTmpPath) {
err = os.Mkdir(curTmpPath, 0755)
if err != nil {
return nil, fmt.Errorf("create temp dir failed: %w", err)
}
}

I recommend adding the __VFOX_CURTMPPATH environment variable to hold the temporary directory.

@jan-bar jan-bar added the bug Something isn't working label Jun 25, 2024
@jan-bar jan-bar added this to the 0.5.4 milestone Jun 25, 2024
jan-bar added a commit to jan-bar/vfox that referenced this issue Jun 25, 2024
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.

1 participant