auto-session icon indicating copy to clipboard operation
auto-session copied to clipboard

[BUG] [WINDOWS] Special characters are not saved properly

Open kishikaisei opened this issue 2 years ago • 2 comments

Describe the bug The path for the sessions is not shown properly, functionally they work, but visually they are wrong: C:/path/to/project is shown as C++%path%to%project (: -> ++, and / -> %)

To Reproduce Steps to reproduce the behavior:

  1. Save any session on windows
  2. Open "autosession search"

Expected behavior A clear and concise description of what you expected to happen. To see the path correctly with the proper characters

Screenshots If applicable, add screenshots to help explain your problem. image

Baseline (please complete the following information):

  • Windows 11 21H2
  • Neovim version v0.8.0-dev+519-g6f6286e4f
  • https://gitlab.com/kishikaisei/nvim

kishikaisei avatar Jul 12 '22 17:07 kishikaisei

Hey @kishikaisei thanks for the issue submission! 🎉 I'd be happy to accept a PR if you or anyone's got some free time to dive into this. I don't really have the means to look deeper into Windows issues with this plugin unfortunately.

rmagatti avatar Jul 14 '22 05:07 rmagatti

within Windows operating systems there are different restrictions concerning usable characters for valid file and folder names. to name a few obvious ones:

  • no case-sensitivity for file names on windows systems
  • no colons : within a file name. only to separate the drive identifier from the rest of the path
  • no backslash \ within the file names as they are used to separate folders
  • ...

thus, the replacement of : with ++ and \ with % at least renders the file names valid for session files. This is not very pretty (I would prefer a simple underscore _ for any of the invalid characters) but at least, windows doesn't get confused.

@kishikaisei : what would you like to see as a "solution", here?

If it was only about representing that session file name within the nvim editor when listing all available sessions, that should not be such a big problem for implementation,

nnako avatar Feb 18 '23 13:02 nnako