Comments (8)
Usually the :
character needs to be escaped at the console via \:
or the whole filename encapsulated with ""
:
micro something-2024-01-15T19\:03\:33Z.log
micro "something-2024-01-15T19:03:33Z.log"
To be honest...from my point of view this isn't a problem of micro
.
from micro.
This is not a problem of shell escaping the colon: https://asciinema.org/a/MojjVMqT9g4yxmO87ekrbiLq2
Showing further, this is internal to Micro's open logic. Also happens with the 'open' command within Micro's console: https://asciinema.org/a/Z4S1gvhQ2kYI6lNPMXYDSwFVE
from micro.
Does cat
or less
behave the same in your zsh
?
For me the same (using ''
, ""
& \:
) works with open
from within micro
.
from micro.
Does
cat
orless
behave the same in yourzsh
?
It does not. This is not a shell issue. I can use Bash or sh and get the same behavior. I can write a Python subprocess.run
wrapper to call Micro with the arguments passed directly. All of these have the same behavior.
from micro.
Ok, then let me guess:
You've the parsecursor
option enabled in your options.
parsecursor
: if enabled, this will cause micro to parse filenames such as file.txt:10:5 as requesting to openfile.txt
with the cursor at line 10 and column 5. The column number can also be dropped to open the file at a given line and column 0. Note that with this option enabled it is not possible to open a file such asfile.txt:10:5
, where:10:5
is part of the filename. It is also possible to open a file with a certain cursor location by using the+LINE:COL
flag syntax. Seemicro -help
for the command line options.
default value: false
This option now is in conflict with your or your service chosen filenames.
A potential fix is then to apply more or less the same regex pattern as it would have been opened with +LINE:COL
here:
https://github.com/zyedidia/micro/blob/master/internal/util/util.go#L318
from micro.
Thank you. It's not obvious that this option is available, (default?) and interferes with the normal course of opening files. That should probably be mentioned somewhere conspicuous.
It also seems like the parsing could be smarter. My files did not end with a colon and a line number. They happened to contain a colon followed by many other characters that couldn't possibly be construed as a line/column indicator. Why doesn't the parser bail out in this case?
Usability wise it seems the +LINE:COL
should be the only mechanism available. But if Micro is set on using filename:LINE:COL
form (maybe it's for the case of opening more than 1 file?), then the parsing should probably look for an exact pattern, and treat it as a filename otherwise.
I'm satisfied for now. I've just disabled the option.
from micro.
The most user wouldn't have a problem with that scenario due to the fact that it isn't the default option, but yes this option isn't intended to fail in this scenario...especially since the documentation every time refers to [FILENAME]:LINE:COL usage.
It also seems like the parsing could be smarter. My files did not end with a colon and a line number.
And it's now exactly fixed to search for that option at the end or more detailed after the filename.
from micro.
You can enable parsecursor
again after the PR has been merged or you fix it locally with a patch. 😉
Unfortunately the merge window isn't under my control.
from micro.
Related Issues (20)
- Micro 2.0.13 (Windows only) crashes when selecting a directory with "open" HOT 1
- IsWhitespace from util package not working HOT 6
- Alt-Shift-Left or Alt-Shift-Right are not recognized desipte getting detected in raw HOT 2
- Disable micro auto formatting bindings.json when adding new bindings HOT 1
- Garbled contents when reloading file with DOS line endings HOT 8
- Inconsistent keybindings behavior for Alt Shift Combinations HOT 4
- file manager plugin .. go up not work HOT 2
- Feature Request: Editor Width/Margins HOT 2
- JumpToMatchingBrace inconsistent with adjacent unpaired braces e.g. )[ or }( or )( HOT 11
- disable error HOT 2
- Confusion over missing bindings
- Differing copy-paste mechanics between tmux and non-tmux HOT 1
- Calling clipboard.Write in lua crashes micro HOT 6
- 2.0.13 micro-2.0.13-linux-arm.tar.gz may have been tampered with HOT 11
- Micro panics when cd-ing to root
- How to toggle softwrap + wordwrap in editor, and how to make it a default setting? HOT 2
- Colors in Color Schems appear wrong. HOT 2
- DeleteLine does not delete selected lines HOT 7
- Micro reindents settings.json files with spaces on open HOT 1
- Nightly builds are not the current master branch 😭 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro.