done icon indicating copy to clipboard operation
done copied to clipboard

Is it possible that this could cause Ghostty to hang on long running processes?

Open blacktop opened this issue 1 year ago • 11 comments

Please see https://github.com/ghostty-org/ghostty/issues/1917

blacktop avatar Jul 03 '24 21:07 blacktop

That repository doesn't seem to be available. Maybe it is private?

franciscolourenco avatar Jul 03 '24 21:07 franciscolourenco

Ah yes it is, I apologize. https://mitchellh.com/ghostty @mitchellh might be able to add you if you want. It's his awesome NEW terminal. With done installed fish hangs after running tree .

blacktop avatar Jul 03 '24 21:07 blacktop

Hello! I'd be happy to add you @franciscolourenco but I consider any functionality that works in other terminals and not mine a bug with my own terminal 😄 So I don't think this is a done bug. I'll invite you anyways though!

mitchellh avatar Jul 03 '24 21:07 mitchellh

Thank you @mitchellh, that makes sense :)

franciscolourenco avatar Jul 04 '24 07:07 franciscolourenco

Sorry @franciscolourenco you can't see our issue but I've tracked this down to an upstream issue: https://github.com/julienXX/terminal-notifier/issues/301 Specifically from my thread:

Okay I've installed done with fish and I can reproduce this only with terminal-notifier installed. I can actually reproduce this purely with terminal-notifier:

# This hangs!
$ echo "hello" | terminal-notifier -title "Hello" -sender "com.mitchellh.ghostty"

It looks like terminal-notifier itself is hanging for some reason.

I'm not sure why it hangs with the Ghostty ID. But it appears based on the previous issue this isn't unique. I don't see any smoking guns in logs anywhere.

mitchellh avatar Jul 08 '24 17:07 mitchellh

Btw, I was surprised to see that done doesn't use OSC9 or OSC777 (native terminal desktop notifications) supported by Kitty, WezTerm, foot, and iTerm2. Ghostty also supports these. That would make done not require any dependencies and it wouldn't have to shell out either.

Their usage:

OSC 9

OSC 9 ; <body> ST

OSC 777

OSC 777 ; notify ; <title> ; <body> ST

mitchellh avatar Jul 08 '24 17:07 mitchellh

@mitchellh unfortunately this doesn't work when the process is in a detached tmux session or the shell is otherwise not interactive

peter-cardenas-ai avatar Jul 08 '24 17:07 peter-cardenas-ai

@mitchellh unfortunately this doesn't work when the process is in a detached tmux session or the shell is otherwise not interactive

True! But if the shell is interactive and it's not tmux, it does work, which I feel would still be pretty common?

mitchellh avatar Jul 08 '24 17:07 mitchellh

ping

blacktop avatar Jul 16 '24 22:07 blacktop

I'd say if you were thinking about implementing @mitchellh ideas we could keep this open @franciscolourenco otherwise I think we can close it.

blacktop avatar Jul 16 '24 22:07 blacktop

@blacktop will have to follow up on OSC 9 and OSC 777 in a different thread. I'll leave this open for now just for reference. Thanks!

franciscolourenco avatar Jul 16 '24 23:07 franciscolourenco

I just started running into this issue. I'm using iTerm and tmux. Not sure why it just started happening, I've been using done for several years now with no issue. I was able to reproduce directly with terminal-notifier, so it seems like the problem is indeed over there. That issue seems specific to the -sender option, so I was able to work around by overriding the notification command in my fish config like this:

set -U __done_notification_command "echo \$message | terminal-notifier -title \$title"

The terminal-notifier issue linked above is still open, so it might be good to document this workaround or just keep the issue open for anyone else who runs into it (although I would recommend editing the title since we know this isn't specific to Ghostty).

jcelliott avatar Oct 08 '25 20:10 jcelliott