feat: add use_absolute_paths to files picker #2396
Open
+8
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I think this improvement could be quite useful for some users. The file picker is extended with a new property,
use_absolute_paths
, which simply disables the$HOME
replacement with~
when displaying paths.I’ve been using this feature for a year already, and it has helped me a lot in scenarios where I have an absolute file path (e.g., generated by a script, linter, or any other external source) and want to open it using the file picker. By default, since all paths start with
~
, the results window remains empty even if the file actually exists.Here’s the current behavior:
because all the paths start with
~
:The main issue is that I can’t locate a file using the path I’ve copied from a linter output in another terminal. I either have to convert the path to a relative one or configure the linter (or another tool) to generate relative paths. This can also happen when someone shares an absolute path, and you want to open that file directly.
Here’s how it works when
use_absolute_paths
is passed to the file picker with a value oftrue
:Let me know your thoughts. If any other picker could benefit from the same behavior, I’d be happy to update them as well. Personally, I only use the file picker, as this is the only scenario where the issue occurs.