Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add exit flag to allow for exiting after selection is made #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xch4z
Copy link

@0xch4z 0xch4z commented Jan 7, 2023

Resolves #37

This adds a new flag (-e or --exit) that exits the process after a selection is made when dmenu-mac is launched without arguments.

Resolves oNaiPs#37

This adds a new flag (`-e` or `--exit`) that exits the process after a
selection is made when `dmenu-mac` is launched without arguments.
@@ -207,9 +208,7 @@ Ensure you are using a unique, valid shortcut.

func closeApp() {
clearFields()
if promptValue == "" {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change isn't necessary, just saw this could be simplified as PipeListProvider.doAction terminates the app before this code is reached -- promptValue == "" will always evaluate to true.

@oNaiPs
Copy link
Owner

oNaiPs commented Feb 21, 2023

@0xch4z thanks for your contribution! I think you're 100% right, we should be exiting the CLI after the selection is made. Would you mind change your PR so that is the default behavior?

@gurland
Copy link

gurland commented Jun 25, 2024

I was trying to implement one-time run as a default behaivour via adding --stay-alive flag, but after consideration I have something to discuss.

I think it's a breaking change that affects the flow for all users. If we leave this flag as an option it won't break compatibility with the way of usual launch of the program.

If we want to introduce a breaking change then maybe it's better to implement --daemonize flag (common for other gnu/linux software that could launch as a fork daemon). I don't know much about Swift and Apple SDKs, but I found this article and maybe it's better to manage the process by launchd if the --daemonize flag is passed?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dmenu doesn't exit after selecting an application
3 participants