hermes - 💡(How to fix) Fix Set JetBrains terminal/console title from foreground Hermes UI on first request [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#17148Fetched 2026-04-29 06:37:03
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Root Cause

That does not affect the IntelliJ terminal tab because the terminal() tool runs in a separate captured subprocess/pty. Its stdout/stderr is collected by Hermes and returned as tool output after the command exits. The OSC escape bytes do not reach the user's actual JetBrains terminal/console pty as terminal control bytes.

Code Example

printf '\033]0;%s\007' 'TrikeShed fanout Binance stochastic cache'

---

print(f"\033]0;{title}\007", end="", flush=True)
print(f"\033]2;{title}\007", end="", flush=True)
RAW_BUFFERClick to expand / collapse

Request

Hermes should set the visible terminal/console title on the first user request, and it should work when Hermes is running inside JetBrains/IntelliJ terminal/console environments.

Concrete desired behavior:

  • On the first user request in a session, derive a short title from the task/session.
  • Emit/set that title from the foreground Hermes UI process, not from a tool subprocess.
  • The visible JetBrains terminal tab/console title should become something like: TrikeShed fanout Binance stochastic cache
  • This should not depend on the model using the terminal tool.

Why the obvious implementation fails

We tried this from inside a Hermes terminal tool subprocess:

printf '\033]0;%s\007' 'TrikeShed fanout Binance stochastic cache'

That does not affect the IntelliJ terminal tab because the terminal() tool runs in a separate captured subprocess/pty. Its stdout/stderr is collected by Hermes and returned as tool output after the command exits. The OSC escape bytes do not reach the user's actual JetBrains terminal/console pty as terminal control bytes.

Sending OSC escapes in the agent's text response is also unreliable: it may render as literal text, be sanitized, or be ignored by the JetBrains console path.

Implementation implications

The title-setting needs to happen in Hermes' foreground CLI/render path, near where the interactive UI owns the real terminal stdout/pty, e.g. conceptually:

print(f"\033]0;{title}\007", end="", flush=True)
print(f"\033]2;{title}\007", end="", flush=True)

Do not implement this through terminal() or any other captured tool execution path.

JetBrains-specific challenges to handle/test

  • JetBrains terminal/console may not honor OSC title sequences in all modes.
  • IntelliJ Terminal and Run/Debug Console may have different escape handling.
  • If Hermes is launched under the JetBrains terminal, OSC 0/2 should be emitted by the foreground Hermes process.
  • If Hermes is embedded through ACP/IDE integration rather than a real terminal, there may be no tty title to set; in that case the ACP/IDE adapter may need a separate title/update hook.
  • If tmux/screen is present, the correct behavior may be tmux window rename rather than direct terminal title, or direct OSC passthrough depending on terminal settings.
  • Avoid emitting raw OSC in gateway/messaging platforms where it will appear as literal text.

Acceptance criteria

  • First user request in an interactive CLI session sets the terminal title from the foreground Hermes process.
  • The feature is gated to local interactive terminal contexts, not gateway/chat text responses.
  • Works or gracefully no-ops when stdout is not a TTY.
  • JetBrains/IntelliJ behavior is documented: either supported via OSC from foreground CLI, or explicitly marked unsupported with the reason.
  • Add a small test around title emission routing so regressions do not reintroduce tool-subprocess based title setting.

extent analysis

TL;DR

Set the terminal title from the Hermes foreground process using OSC escape sequences.

Guidance

  • Identify the correct location in the Hermes codebase to set the terminal title, likely near where the interactive UI owns the real terminal stdout/pty.
  • Use OSC escape sequences (\033]0;{title}\007 and \033]2;{title}\007) to set the title, ensuring to flush the output immediately.
  • Consider the implications of running in different environments, such as JetBrains Terminal, Run/Debug Console, tmux, or screen, and handle these cases accordingly.
  • Add tests to verify the correct behavior and prevent regressions.

Example

print(f"\033]0;{title}\007", end="", flush=True)
print(f"\033]2;{title}\007", end="", flush=True)

Notes

The implementation may need to account for various edge cases, such as non-TTY stdout, gateway/messaging platforms, and different terminal settings.

Recommendation

Apply a workaround by setting the terminal title from the Hermes foreground process using OSC escape sequences, as this approach is more reliable and flexible than relying on the terminal() tool or other captured subprocesses.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING