You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This essentially boils down to a question how to send a command to micro remotely, via a socket or something. I don't think there is such a possibility, unfortunately.
My knowledge of Micro is about the same as my knowledge of ricing—almost zero. Still, I had an idea you could use as a last resort.
If there's no direct way to send a command to Micro, as a final option, you might be able to make Micro reload itself—maybe through an infinite reload loop or by using a file as a socket.
I’m not sure how to implement this properly, but I had an idea. Once this #3733. gets merged , you could create an overlay that reloads the config continuously or read the content of a file and reload with some condition. It’s definitely not a clean solution, but I tested it and it seems to work.
At least with a Lua plugin someone could implement the necessary interface and access whatever micro exports. It is limited what micro exports, but it is much more than nothing.
Once this #3733. gets merged , you could create an overlay that reloads the config continuously or read the content of a file and reload with some condition.
You mean, a plugin continuously calling ReloadCmd() in a busy loop? I'm not sure what overlays have to do with that, but anyway that would be a really bad idea (I hope I don't need to explain why).
Or you could do that at regular time intervals (I think you can already do that, using a timer, with After()), that would be not as bad, but still feels quite silly.
You mean, a plugin continuously calling ReloadCmd() in a busy loop? I'm not sure what overlays have to do with that, but anyway that would be a really bad idea (I hope I don't need to explain why).
kinda, callingconfig.Reload()(maybe not in every iteration)
I've mention overlays, because I think a plugin with a busy loop would freeze micro, right?
Or you could do that at regular time intervals (I think you can already do that, using a timer, with After()), that would be not as bad, but still feels quite silly.
Could you provide a short snippet or describe a bit more that approach by any chance?
It might be silly but I got curious 😆
Could you provide a short snippet or describe a bit more that approach by any chance?
localtime=import("time")
localinterval=time.ParseDuration("1s")
localfunctionperiodicReload()
config.Reload()
micro.After(interval, periodicReload)
endfunctioninit()
micro.After(interval, periodicReload)
end
BTW please ignore my above suggestion to use ReloadCmd(), it does exactly what the reload command does, so it would not just reload config files but also reinitialize all plugins, including your plugin which calls it, which is probably a bad idea, so you should use config.Reload() which just reloads config files (and it exists specifically for use by plugins).
BTW please ignore my above suggestion to use ReloadCmd(), it does exactly what the reload command does, so it would not just reload config files but also reinitialize all plugins, including your plugin which calls it, which is probably a bad idea, so you should use config.Reload() which just reloads config files (and it exists specifically for use by plugins).
Ty, that's definitely a better approach, although I've noticed whenconfig.Reload() is called my other plugins don't really work.
Activity
dmaluka commentedon May 5, 2025
This essentially boils down to a question how to send a command to micro remotely, via a socket or something. I don't think there is such a possibility, unfortunately.
cutelisp commentedon May 8, 2025
My knowledge of Micro is about the same as my knowledge of ricing—almost zero. Still, I had an idea you could use as a last resort.
If there's no direct way to send a command to Micro, as a final option, you might be able to make Micro reload itself—maybe through an infinite reload loop or by using a file as a socket.
I’m not sure how to implement this properly, but I had an idea. Once this #3733. gets merged , you could create an overlay that reloads the config continuously or read the content of a file and reload with some condition. It’s definitely not a clean solution, but I tested it and it seems to work.
JoeKar commentedon May 8, 2025
At least with a Lua plugin someone could implement the necessary interface and access whatever
microexports. It is limited whatmicroexports, but it is much more than nothing.dmaluka commentedon May 8, 2025
You mean, a plugin continuously calling
ReloadCmd()in a busy loop? I'm not sure what overlays have to do with that, but anyway that would be a really bad idea (I hope I don't need to explain why).Or you could do that at regular time intervals (I think you can already do that, using a timer, with
After()), that would be not as bad, but still feels quite silly.A better approach would be to use something like https://pkg.go.dev/github.com/fsnotify/fsnotify...
cutelisp commentedon May 9, 2025
kinda, calling
config.Reload()(maybe not in every iteration)I've mention overlays, because I think a plugin with a busy loop would freeze micro, right?
Could you provide a short snippet or describe a bit more that approach by any chance?
It might be silly but I got curious 😆
dmaluka commentedon May 9, 2025
BTW please ignore my above suggestion to use
ReloadCmd(), it does exactly what thereloadcommand does, so it would not just reload config files but also reinitialize all plugins, including your plugin which calls it, which is probably a bad idea, so you should useconfig.Reload()which just reloads config files (and it exists specifically for use by plugins).cutelisp commentedon May 9, 2025
Ty, that's definitely a better approach, although I've noticed when
config.Reload()is called my other plugins don't really work.dmaluka commentedon May 9, 2025
Sounds like a bug.
SLUCHABLUB commentedon Aug 18, 2025
You could define
SIGUSR1to reload the config. That is what kitty does. I don't know however if the signals are taken yet however.