Skip to content

fix(cli): make refresh_interval configurable, default to 0 (disabled) - #48312

Closed
OYLFLMH wants to merge 1 commit into
NousResearch:mainfrom
OYLFLMH:fix/cli-refresh-interval-auto-scroll
Closed

fix(cli): make refresh_interval configurable, default to 0 (disabled)#48312
OYLFLMH wants to merge 1 commit into
NousResearch:mainfrom
OYLFLMH:fix/cli-refresh-interval-auto-scroll

Conversation

@OYLFLMH

@OYLFLMH OYLFLMH commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Problem

Commit 6724daa2c ("fix: keep CLI idle timer ticking #45592") added refresh_interval=1.0 to the prompt_toolkit Application in non-fullscreen classic CLI mode. This causes a full UI redraw every second during idle time.

Terminal emulators with "auto-scroll on output" (Xshell, iTerm2, Windows Terminal, etc.) interpret the ANSI output from each redraw as new content and auto-scroll the viewport to the bottom — even when the user has manually scrolled up to read conversation history.

Fixes: #48309

Root Cause

The original code explicitly warned against this (cli.py ~L12927 before 6724daa2c):

# Do not repaint the idle prompt every second. In non-full-screen
# prompt_toolkit mode, background redraws can fight tmux/Ghostty/cmux
# viewport restoration after focus changes...

Change

Drive refresh_interval from display.cli_refresh_interval in config.yaml, defaulting to 0 (disabled — the pre-0.15.2 behavior). Users who want the idle clock to keep ticking can set it to 1.0 (or any positive value).

cli.py (1 line change)

# Before (hardcoded):
refresh_interval=1.0,

# After (config-driven, default 0 = off):
refresh_interval=float(CLI_CONFIG.get("display", {}).get("cli_refresh_interval", 0)),

hermes_cli/config.py (1 key added)

"cli_refresh_interval": 0,  # seconds; 0 = disabled

Testing

  • python3 -m py_compile cli.py hermes_cli/config.py — passes
  • scripts/run_tests.sh tests/cli/ — 78 files, 924 tests, 0 failures
  • Manual verification: idle scrolling stays put on Xshell (SSH)

Commit 6724daa added refresh_interval=1.0 to keep the idle clock
ticking, but unconditional 1 Hz redraws in non-fullscreen prompt_toolkit
mode cause terminal emulators (Xshell, iTerm2, Windows Terminal) to
auto-scroll to the bottom on every tick — breaking scroll-up to read
history.

Drive it from display.cli_refresh_interval (0 = disabled, the default)
so users who want the ticking clock can opt in without affecting everyone.

Fixes: NousResearch#48309
Related: 6724daa, 8972a15
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels Jun 18, 2026
teknium1 added a commit that referenced this pull request Jun 19, 2026
Follow-up to the salvaged #48312 — adds the config-default test (ported
from #48319) and the AUTHOR_MAP entry for the cherry-picked commit.
@OYLFLMH

OYLFLMH commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Closing — the feature was implemented upstream in v0.17.0 (commit 2bd1977) with the same config key (display.cli_refresh_interval) and identical cli.py implementation.

The only difference is the default value: this PR used 0 (disabled), upstream chose 1.0 (enabled, preserving the #45592 clock-ticking fix) with the option to set 0 for terminals affected by #48309.

Both approaches are valid — upstream's choice keeps the existing behavior as default while allowing opt-out, which is the more conservative migration path. No further action needed on this PR.

@OYLFLMH OYLFLMH closed this Jun 21, 2026
xyshanren pushed a commit to xyshanren/hermes-agent-cn that referenced this pull request Jun 25, 2026
Follow-up to the salvaged NousResearch#48312 — adds the config-default test (ported
from NousResearch#48319) and the AUTHOR_MAP entry for the cherry-picked commit.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Follow-up to the salvaged NousResearch#48312 — adds the config-default test (ported
from NousResearch#48319) and the AUTHOR_MAP entry for the cherry-picked commit.
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
Follow-up to the salvaged NousResearch#48312 — adds the config-default test (ported
from NousResearch#48319) and the AUTHOR_MAP entry for the cherry-picked commit.
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
Follow-up to the salvaged NousResearch#48312 — adds the config-default test (ported
from NousResearch#48319) and the AUTHOR_MAP entry for the cherry-picked commit.
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
Follow-up to the salvaged NousResearch#48312 — adds the config-default test (ported
from NousResearch#48319) and the AUTHOR_MAP entry for the cherry-picked commit.
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
Follow-up to the salvaged NousResearch#48312 — adds the config-default test (ported
from NousResearch#48319) and the AUTHOR_MAP entry for the cherry-picked commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: refresh_interval=1.0` causes terminal auto-scroll-to-bottom in non-fullscreen mode

2 participants