micro-editor / micro-editor/micro
When opening the same file in another terminal, micro behaves inconsistently
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
Expected behavior: every time I try to open a file that is already open (and changed) in a different terminal, micro should warn me (I opened another issue #2978 which deals with the nature of the warning and the imho insufficient options micro offers to the user in this situation but this is unrelated).
Actual behavior: micro sometimes warns me when doing that, and sometimes it doesn't. When it doesn't, I may have (unknowingly) 2 conflicting buffers of the same file.
While testing, I have repeatedly reproduced the issue but I didn't manage to figure out what are the exact conditions which trigger this behavior. I think this may be related to me once pressing the 'i' (for ignore) while loading a 2nd buffer of the same file - then even if I close the file in both terminals and then open it again in 1st terminal and make some changes, micro will allow me to open that file in the 2nd terminal without the usual warning. That's my best theory right now. I do see that micro is keeping the "backup" file even when this happens, so I suppose there is some "flag" it sets [for a particular file?] which (when set) allows then to open 2 conflicting buffers. And that "flag" seemingly doesn't get reset, at least not every time.
Specifications
Commit hash: c2cebaa
OS: Debian
Terminal: xterm (SSH with mobaxterm)
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
Start by reproducing the cross-terminal file-opening scenario described on Debian, including pressing “i” while loading the second buffer. Compare cases where micro warns with cases where it does not, and inspect how the backup file and any associated state behave after both terminals close. Done means identifying the trigger and making repeated opens consistently warn.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100