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

:pre not working on macOS, missing /var/tmp/vi.recover #35

Open
kajukenbo opened this issue Nov 15, 2023 · 3 comments
Open

:pre not working on macOS, missing /var/tmp/vi.recover #35

kajukenbo opened this issue Nov 15, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kajukenbo
Copy link

:preserve does not seem to work with macOS/homebrew v7.4.26 using the default /var/tmp/vi.recover location.

Low priority.

Works normally on GNU/Linux (compiled).

Simple missing directory:

$ ovi -r
Error: recdir: /var/tmp/vi.recover: No such file or directory

~
:pre
Preservation of this file not possible

:set recdir?
recdir="/var/tmp/vi.recover"

$ ls -la /var/tmp/vi*
ls: /var/tmp/vi*: No such file or directory

/var/tmp does exist so maybe add mkdir -p /var/tmp/vi.recover to the build process somehow?
Appears to work like I'd expect once I do that manually.

mkdir -p /home/kajukenbo/vi.recover and set recdir="/home/kajukenbo/vi.recover" also seems to work.

Thanks as always for keeping vi alive.

@johnsonjh
Copy link
Owner

@kajukenbo

Thanks for the report, confirmed.

A quick search shows that /private/var/tmp/ is probably the correct location for macOS. The /tmp is a symlink to /private/tmp and it looks like /var/tmp is a hard link to /private/var/tmp but I have double check to be sure.

Ideally, the preserve directory should be something that doesn't get deleted too often, and isn't in a private namespace, so you can run the recover script on unclean reboot. However, (since nobody really runs it anymore), if we do use a private namespace, I can just have OpenVi itself make the subdirectory if it's missing.

So, let me think a bit more about how to best handle it, but a fix should be easy enough and will come soon.

@johnsonjh johnsonjh self-assigned this Nov 15, 2023
@johnsonjh johnsonjh added the bug Something isn't working label Nov 15, 2023
@johnsonjh johnsonjh added the low priority low priority issue label Nov 22, 2023
@johnsonjh johnsonjh changed the title Low priority ~ :pre not working on macOS, missing /var/tmp/vi.recover :pre not working on macOS, missing /var/tmp/vi.recover Nov 22, 2023
@johnsonjh johnsonjh added this to the 7.5 milestone Nov 22, 2023
@kajukenbo
Copy link
Author

kajukenbo commented Feb 9, 2024

Just a heads-up, this now (?) seems to occur with Linux builds on compiled OpenVi 7.4.27.
I just compiled it on a new install to make sure it was not my imagination.

Maybe it worked before since I was using nvi and it automatically made /var/tmp/vi.recover beforehand?

Version 7.4.27 (OpenVi) 09/07/2023.

:set recdir?
recdir="/var/tmp/vi.recover"
:pre
Preservation of this file not possible.

The work-around still seems to be:

# sudo mkdir -m 1777 -p /var/tmp/vi.recover

@johnsonjh
Copy link
Owner

@kajukenbo

I'm not really sure if there is an equivalent to this directory on macOS that exists by default in the current versions, that is, something that is a shared amongst users and doesn't get cleaned up automatically too often, or on reboots.

There does seem to be a /private/var/tmp directory, which I think doesn't get cleaned out on reboot. It's only for the current user, but I think that's OK.

I'll look into it, but on macOS, I think using /private/var/tmp as _PATH_PRESERVE for recdir could work.

In the meantime, you can try adding set recdir="/private/var/tmp" to your .(n)exrc file and seeing if that works the way you want.

@johnsonjh johnsonjh removed the low priority low priority issue label Feb 29, 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

No branches or pull requests

2 participants