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
{{ message }}
Repository navigation
question: updating flyline from signal handlers #852
When switching between dark and light mode on my system, shells receive the SIGUSR2 signal and run handler functions for specific programs to update them (if they cannot update automatically). Flyline is updated by running flyline set-style ... from the signal handler.
This seems to be working in general. I noticed, though, that I need to run a (single) command (doesn't matter which one) for flyline to actually update the colors. Moreover, other programs like herdr (terminal multiplexer) are receiving an update too, and this update also only applies after I ran one command in flyline.
I dug a bit. Here is what I found: While the interactive shell sits at the prompt, it is blocked inside readline (or flyline for that matter). Bash treats that wait like a foreground command. From the Bash man page:
If bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes.
A common workaround seems to be using SIGALRM, which readline handles specifically. Do you think this would also make sense for flyline (at least delegating the signal or something)?
You can see it here. It's a simple trap '<HANDLER>' <SIGNAL NAME>. In my case, I call function (trap __hermes__signal_handler_sigusr2 SIGUSR2) which runs a few other functions to update color variants (light-dark-theme).
@HalFrgrd If you want me to, I can open PR(s) to upstream the changes from my fork. Would you be interested? The commits are here. I am rebasing onto your master once in while to keep the branches up-to-date. I currently have three patches:
Yes please! If you are a light mode terminal user, I would be interested in what you think of the light mode palette. Especially the new scrollbar color / hover / depress styles. I'm not a light mode user so would appreciate someone to take a look at it!
I am using light during the day and dark during the night. I run a custom flyline theme, but I will gladly give feedback on the defaults. Let me start with upstreaming the changes and I will provide feedback on the defaults afterward.
Having only one codegen unit increases compile times, so I am hesitant, but this would provide the benefit of having better optimized code in release builds. We could also go for 2 or 4. The default is 16.
Activity
georglauterbach commentedon Jul 29, 2026
I dug a bit. Here is what I found: While the interactive shell sits at the prompt, it is blocked inside
readline(orflylinefor that matter). Bash treats that wait like a foreground command. From the Bash man page:A common workaround seems to be using
SIGALRM, whichreadlinehandles specifically. Do you think this would also make sense forflyline(at least delegating the signal or something)?georglauterbach commentedon Jul 29, 2026
Here is a diff file to the current state of main (665e65a) that implements the signal handling logic:
signal_handlers.diff.txt
HalFrgrd commentedon Aug 11, 2026
Hey, I'm just getting to look at this now. Do you mind explaining how you setup your shell to handle SIGUSR2? Im not familiar.
georglauterbach commentedon Aug 11, 2026
You can see it here. It's a simple
trap '<HANDLER>' <SIGNAL NAME>. In my case, I call function (trap __hermes__signal_handler_sigusr2 SIGUSR2) which runs a few other functions to update color variants (light-dark-theme).georglauterbach commentedon Aug 15, 2026
@HalFrgrd If you want me to, I can open PR(s) to upstream the changes from my fork. Would you be interested? The commits are here. I am rebasing onto your
masteronce in while to keep the branches up-to-date. I currently have three patches:releaseprofileHalFrgrd commentedon Aug 15, 2026
Yes please! If you are a light mode terminal user, I would be interested in what you think of the light mode palette. Especially the new scrollbar color / hover / depress styles. I'm not a light mode user so would appreciate someone to take a look at it!
georglauterbach commentedon Aug 15, 2026
I am using light during the day and dark during the night. I run a custom flyline theme, but I will gladly give feedback on the defaults. Let me start with upstreaming the changes and I will provide feedback on the defaults afterward.
georglauterbach commentedon Aug 15, 2026
First PR is #931. I will be adding a second MR for cursor fades once #931 is merged.
I also propose updating the release profile:
[profile.release] panic = "unwind" overflow-checks = true lto = true +codegen-units = 1Having only one codegen unit increases compile times, so I am hesitant, but this would provide the benefit of having better optimized code in release builds. We could also go for
2or4. The default is 16.HalFrgrd commentedon Aug 15, 2026
Thanks for the tip, I tested
codegen-units = 1and pushed to master.feat: move settings into a global var (#935)
georglauterbach commentedon Aug 16, 2026
Closed by #935 and b3ab32a