Skip to content

[BUG] session.xml backup paths are stored as absolute paths but the backups themselves are stored relative to npp's folder which breaks session.xml if npp's folder were renamed or moved #15886

@rust2

Description

@rust2

Is there an existing issue for this?

Description of the Issue

So, session.xml backup paths are stored as absolute paths but the backups themselves are stored relative to npp's folder which breaks session.xml if npp being launched after its folder was renamed or moved. This just happens to me between windows reinstallations as I use it in portable mode.
It can also break absolutely easy if npp is used from flash drive and windows just assign another letter to the drive

Steps To Reproduce

  1. unpack portable npp
  2. start npp
  3. make new file
  4. edit it
  5. close npp
  6. check session.xml that it have absolute path to new file's backup
  7. rename or move npp's folder
  8. start npp
  9. you lost your unsaved edited new file

Current Behavior

as described in steps 7~9

Expected Behavior

as backups stored relative to npp's executable folder, session.xml should also have paths that are relative to npp's executable.

Current: backupFilePath="D:\Users\Rustam\Desktop\0Notepad++\backup\new 5@2024-11-30_165530"
Expected: backupFilePath="backup\new 5@2024-11-30_165530"

Debug Information

Notepad++ v8.7.1   (64-bit)
Build time : Oct 31 2024 - 00:48:56
Path : D:\Users\kww\Desktop\0Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 10 Enterprise LTSC 2021 (64-bit)
OS Version : 21H2
OS Build : 19044.1288
Current ANSI codepage : 1251
Plugins : 
    ComparePlugin (2.0.2)
    EmmetNPP (1.0.2)
    HexEditor (0.9.12)
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    NPPJSONViewer (1.40)
    PythonScript (2)

Anything else?

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions