micro-editor / micro-editor/micro
Open Command Misusing '\n' In Paths
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
Description of the problem or steps to reproduce
Note: while this issue is present in Linux, it's really only a problem in Windows, as using tab to auto-complete path segments terminates directories with back-slashes.
When trying to open a path in which a sub-directory's name starts with a lowercase 'n', the preceding backslash is dropped, and--consequently--the wrong file path is used.
Using forward-slashes avoids the issue, but is a huge pain, as tab-completion uses back-slashes and won't work after a forward-slash. So if you auto-complete the path, it must then be manually modified.
Specifications
Using the command open abc\nothing results in opening the file abcnothing
Using forward-slashes or capital N's works as expected: open abc/nothing results in abc/nothing and open abc\Nothing results in abc\Nothing
I assume this issue has to do with '\n' corresponding to the newline character. Although, I would have thought both the back-slash and the 'n' would have been dropped, so perhaps not.
Commit hash: b9763856
OS: Windows 10 Pro
Terminal: Windows Terminal Preview - Powershell
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the open command on Windows using abc\nothing, then compare it with forward slashes and an uppercase N. Start by tracing the open command's path handling and the treatment of backslash-n sequences; done means tab-completed Windows paths beginning with \n open the intended file without manual edits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100