Skip to content
Discussion options

You must be logged in to vote

One way I found is to perform additional checks like:

    if not sys.argv[1:] and sys.stdin and sys.stdin.isatty():
        run_gui()

and it works since the sys.stdin.isatty() is False when running from [TAB][TAB],
but I haven't fully tested it yet, and there might be a better way to do this.

EDIT:
Actually, since it looks like _MYAPP_COMPLETE env var is set in every compdef (bash zsh etc.) It is a better way to check if we are in the application from [TAB][TAB]

if not sys.argv[1:] and "_MYAPP_COMPLETE" not in os.environ:
    run_gui()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem shell / zsh
1 participant
Converted from issue

This discussion was converted from issue #543 on September 19, 2025 13:47.