Satty icon indicating copy to clipboard operation
Satty copied to clipboard

"Save as" function is broken when --early-exit flag is set

Open killeik opened this issue 1 month ago • 3 comments

Version

Arch Linux build satty 0.20.0, and manual build at b1b16eaa118eefac7dd8ac4b7c2d3070207ea4b3

Description

Was found here: https://github.com/basecamp/omarchy/issues/2421 OP does have a video recording of it

Reproducible with grim -g "$(slurp -o -r )" -t ppm - | satty --filename - --early-exit And pressing "Save As"

killeik avatar Nov 03 '25 12:11 killeik

There is some related discussion in #152.

RobertMueller2 avatar Nov 03 '25 13:11 RobertMueller2

TL;DR of the mentioned discussion, the issue is that the actions have sort of superseded --early-exit. If we don't want to remove it (I think we don't) it needs to be mapped to a sensible behaviour using a set of actions.

RobertMueller2 avatar Nov 03 '25 13:11 RobertMueller2

Scrap that, although the above may still be interesting in the long run. I assume the issue is that handle_save_as asynchronously spawns a modeless dialog. Which is kinda in line with how the other dialogs work.

I think the easiest fix would be to handle "save as" separately from the other actions. handle_save_as could probably do its own check if early exit is set and then exit if so. However, that way "save as" could not be combined with other actions. We don't allow that now for either command line or configuration so this would not hurt from a user experience perspective. But to avoid any confusion for code readers, I feel that we should also remove SaveToFileAs from actions altogether if we go that route. This would be fine until somebody else requests a feature for "save as" as an action that can be used on the command line or configuration. ;)

Other alternatives I could think of:

  • disable "save as" when early exit is set, seems a bit lame
  • don't exit upon "save as", shares some of the concerns in the last paragraph, also makes it unintuitive
  • make the dialog blocking, makes it inconsistent with other dialogs
  • make the dialog blocking only if early exit is set. This would not fix a consecutive exit action, if we ever wanted to allow it for command line/config usage, also makes handle_save_as considerably more complicated

Each of the above is ugly in its own way. Maybe anyone has any other ideas.

RobertMueller2 avatar Nov 03 '25 17:11 RobertMueller2