Skip to content

Conversation

mathias4833
Copy link
Contributor

Purpose

Path autocompletion wasn't working when using ~ as a shortcut for the home directory. The issue occurred because the tilde was expanded to /home/user, which caused the suggestion to no longer match the input (thus preventing the autocompletion from appearing in the suggestion list).

To fix this, I replaced the custom parentAndBase function, which handled path splitting in a more complex way, with filepath.Split from the standard path/filepath package. This prevents tilde expansion while keeping the expected behavior for path splitting.

Testing

The issue has been tested manually on Linux.

Screenshots

screenshot

@calmh
Copy link
Member

calmh commented Mar 15, 2025

Right, and this works because the tilde expansion also happens in the creation of the filesystem we browse inside. Nice.

@calmh calmh merged commit 67575e1 into syncthing:main Mar 15, 2025
24 checks passed
@tomasz1986
Copy link
Member

Just a side note, but path autocompletion when using ~ doesn't seem to work in Windows at all. This is the case both after and before this change though.

@calmh calmh modified the milestones: v1.29.3, v1.29.4 Mar 18, 2025
@mathias4833
Copy link
Contributor Author

Just a side note, but path autocompletion when using ~ doesn't seem to work in Windows at all. This is the case both after and before this change though.

I tested on Windows and it works fine on my end (Windows 11 build 26100.3476, go1.24.1). Could you provide more details about your setup (Windows version, etc.) ?

calmh added a commit to p0l0us/syncthing that referenced this pull request Mar 28, 2025
* main: (175 commits)
  build: move nightly build schedule to separate workflow (syncthing#10000)
  chore(syncthing): use file lock on certificate to prevent multiple instances (syncthing#10003)
  chore(ur): add RSS to reported stats (syncthing#10002)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(gui, man, authors): update docs, translations, and contributors
  fix(api): prevent tilde expansion in path suggestions (fixes syncthing#9990) (syncthing#9992)
  fix(syncthing): don't auto upgrade to higher major on startup (syncthing#9989)
  build(deps): update dependencies (syncthing#9988)
  chore(gui, man, authors): update docs, translations, and contributors
  refactor(api): extract method configMuxBuilder.postAdjustGui and add test coverage (syncthing#9979)
  refactor(api): make shutdown timeout configurable for tests (syncthing#9980)
  refactor(api): deduplicate HTTP test helpers and allow session cookie access (syncthing#9977)
  build: correct API call for Weblate statistics
  build(deps): update dependencies (syncthing#9978)
  chore(etc): remove /usr/bin prefix from Linux .desktop files (syncthing#9966)
  build: use Go 1.24, minimum is Go 1.23 (syncthing#9960)
  fix(policy): do not require multiple maintainers for build changes
  chore(gui, man, authors): update docs, translations, and contributors
  chore(fs): build kqueue instead of fsevents watcher on iOS (syncthing#9950)
  build(deps): update dependencies (syncthing#9951)
  ...
calmh added a commit to tomasz1986/syncthing that referenced this pull request Mar 28, 2025
…-is-disabled-for-Send-Only-folders

* main: (266 commits)
  build: move nightly build schedule to separate workflow (syncthing#10000)
  chore(syncthing): use file lock on certificate to prevent multiple instances (syncthing#10003)
  chore(ur): add RSS to reported stats (syncthing#10002)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(gui, man, authors): update docs, translations, and contributors
  fix(api): prevent tilde expansion in path suggestions (fixes syncthing#9990) (syncthing#9992)
  fix(syncthing): don't auto upgrade to higher major on startup (syncthing#9989)
  build(deps): update dependencies (syncthing#9988)
  chore(gui, man, authors): update docs, translations, and contributors
  refactor(api): extract method configMuxBuilder.postAdjustGui and add test coverage (syncthing#9979)
  refactor(api): make shutdown timeout configurable for tests (syncthing#9980)
  refactor(api): deduplicate HTTP test helpers and allow session cookie access (syncthing#9977)
  build: correct API call for Weblate statistics
  build(deps): update dependencies (syncthing#9978)
  chore(etc): remove /usr/bin prefix from Linux .desktop files (syncthing#9966)
  build: use Go 1.24, minimum is Go 1.23 (syncthing#9960)
  fix(policy): do not require multiple maintainers for build changes
  chore(gui, man, authors): update docs, translations, and contributors
  chore(fs): build kqueue instead of fsevents watcher on iOS (syncthing#9950)
  build(deps): update dependencies (syncthing#9951)
  ...
@calmh calmh added the bug A problem with current functionality, as opposed to missing functionality (enhancement) label May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants