micro-editor / micro-editor/micro

Save after POSIX signal

Open
#1,888 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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

This is not a bug - it's a feature suggestion. I'm using micro as my always-open notes editor, holding a TODO list and many other little notes. Some of these notes gets edited elsewhere too - for example I have a script that prepends today's date every morning to the top of my TODO file. When this happens, micro asks if I want to reload the file, which puts me in a tricky situation: If I don't reload, I don't see the new day's date, but if I do reload I risk that maybe I have some unsaved changes.

I can't really turn auto-save because it previosuly caused some issues with syncing my notes.

I was wondering if perhaps we could use SIGUSR1 or alike to signal the micro process to trigger a save. If we could do that, all my scripts that edit the files outside of micro could trigger a save before editing the files and I can rest assure no data is lost.

Note that this doesn't really have to be through a POSIX signal - it could be any programmatic way to trigger a save from outside - I just thought a signal might be easier to implement and is already some kind of a universal standard.

Thank you for micro!

Specifications

Commit hash: cc994b62
OS: Arch Linux
Terminal: Alacritty

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating micro’s signal handling and save paths, then clarify the external trigger and behavior around unsaved changes; done means the chosen mechanism reliably saves before external edits and has coverage for the relevant cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.