Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion howdy-gtk/src/authsticky.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,15 @@ def draw(self, widget, ctx):
def catch_stdin(self):
"""Catch input from stdin and redraw"""
# Wait for a line on stdin
comm = sys.stdin.readline()[:-1]
comm = sys.stdin.readline()

# If EOF (empty string), exit
if not comm:
self.exit(None, None)
return False

# Strip newline
comm = comm[:-1]

# If the line is not empty
if comm:
Expand Down
12 changes: 10 additions & 2 deletions howdy/src/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ def exit(code=None):
global gtk_proc

# Exit the auth ui process if there is one
if "gtk_proc" in globals():
gtk_proc.terminate()
if "gtk_proc" in globals() and gtk_proc is not None:
try:
# Try to close stdin to signal EOF to the GTK process
gtk_proc.stdin.close()
# Give it a moment to exit gracefully
gtk_proc.wait(timeout=0.5)
except:
# Force kill if it doesn't exit gracefully
gtk_proc.kill()
gtk_proc.wait()

# Exit compare
if code is not None:
Expand Down