flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
25.01k stars 1.6k forks source link

`flameshot gui` exits with 0 on abort #3321

Open cyqsimon opened 1 year ago

cyqsimon commented 1 year ago

Flameshot Version

Flameshot v12.1.0 (-) Compiled with Qt 5.15.5

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

EndeavourOS, Linux 6.4.12-arch1-1 x86_64

Description

I was trying to use flameshot in scripting, and was surprised to find that flameshot gui does not exit with non-zero status when user aborts. This makes scripting quite a bit more annoying.

The behaviour I expected is to exit with 1 (or whatever) on abort.

Steps to reproduce

  1. Run flameshot gui in terminal
  2. Hit esc to abort
  3. Run echo $?, notice that the status is 0

Screenshots or screen recordings

No response

System Information

Operating System: EndeavourOS KDE Plasma Version: 5.27.7 KDE Frameworks Version: 5.109.0 Qt Version: 5.15.10 Kernel Version: 6.4.12-arch1-1 (64-bit) Graphics Platform: X11

muzilong commented 1 year ago

same problem

Monirzadeh commented 10 months ago

if i use std::exit(1); to bellow part problem can be solve. https://github.com/flameshot-org/flameshot/blob/3d21e4967b68e9ce80fb2238857aa1bf12c7b905/src/main.cpp#L65-L68 is there any specific reason that i should avoid that and force us to use qApp->exit(1);?

serebryakov02 commented 5 months ago

Question for the developers: How can I run Flameshot from the terminal using the source code? When I launch it from Qt Creator and follow the instructions, I do not receive any messages. However, if I download Flameshot as a standalone program and launch it according to the instructions, I can reproduce.

Monirzadeh commented 4 months ago

you should follow this guide than run flameshot in build directory