Skip to content

Conversation

@jdholtz
Copy link
Contributor

@jdholtz jdholtz commented Dec 19, 2025

When setting g:prosession_dir to a custom directory without a trailing slash, this causes the last session file to be saved as <directory>last_session.txt (notice no / between <directory> and last_session.txt.

This PR uses the fnamemodify to ensure a path separator is appended at the end (while still expanding ~).

With my configuration, I had:

init = function()
    vim.g.prosession_dir = vim.fn.stdpath("data") .. "/site/session"
end,

which caused the last_session file to be saved under ~/.local/share/nvim/site/sessionlast_session.txt.

@dhruvasagar
Copy link
Owner

@jdholtz Thanks for adding this, the PR looks good however the build is broken, i'll take a look and share my thoughts accordingly.

@jdholtz
Copy link
Contributor Author

jdholtz commented Dec 31, 2025

Sounds good. I can’t figure out what’s going wrong there. The tests pass locally for me and the failing test doesn’t seem to have to do with my modifications.

@dhruvasagar dhruvasagar merged commit 8fcfc13 into dhruvasagar:master Jan 7, 2026
0 of 2 checks passed
@dhruvasagar
Copy link
Owner

@jdholtz The test failure was a separate issue, thanks

@jdholtz jdholtz deleted the last-session-trailing-slash branch January 7, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants