Codex CLI on Linux makes Bell Sound/Audio Notification upon task completion (which also plays on some remote SSH terminal apps) #1303
dan1487
started this conversation in
Show and tell
Replies: 1 comment
-
I recommend using the Rust CLI, which has a https://github.com/openai/codex/blob/main/codex-rs/config.md#notify |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I made the Codex CLI on Linux make a Bell Sound upon task completion (which also plays on some remote SSH terminal apps). This is very useful because you receive a sound alert when it's done/you need to check back on it, freeing up your time to do other things instead of waiting on the codex CLI.
You have to compile the codex cli yourself and swap their provided terminal-chat.tsx with the one attached here.
terminal-chat.tsx.zip
I used ChatGPT to help me modify that script to make the bell sound, areas of interest seem to be around the following block of code (which passes a process.stdout.write("\x07") to the terminal). Some remote SSH terminals seem to support the bell sound, others don't. Some have a nicer bell sound than others (personally I like the sound that Tabby makes, but dont like the light "thump" sound that Termius makes) - and others have an entirely customizable bell sound.
// Ring the terminal bell when a response finishes streaming.
const prevLoadingBellRef = useRef(false);
useEffect(() => {
if (
prevLoadingBellRef.current &&
!loading &&
confirmationPrompt == null &&
items.length > 0
) {
process.stdout.write("\x07");
}
prevLoadingBellRef.current = loading;
}, [loading, confirmationPrompt, items.length]);
Beta Was this translation helpful? Give feedback.
All reactions