Skip to content

[Bug]: Desktop window doesn't remember its size or position — resets to default on every launch #48539

Closed as not planned

Description

@DSP2012

Bug Description

The desktop app never remembers how big I've made the window or where I put it. Every time it launches it snaps back to the same default size. It's most noticeable right after an update, since that's when it restarts, but it happens on any restart. All my other settings stick fine — just not the window size or position.

Steps to Reproduce

  1. Open the Hermes desktop app.
  2. Resize the window (or move/maximize it).
  3. Quit the app, or let an update restart it.
  4. Reopen — the window is back to the default size/position, ignoring the last change.

Expected Behavior

The window reopens at whatever size and position it was last left at, like a normal desktop app.

Actual Behavior

It always reopens at the default size and position, ignoring the last resize/move. No error or crash — the window state just isn't saved.

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

This is a UI / window-geometry bug with no runtime error or relevant logs, so `hermes debug share` output isn't applicable here. Happy to provide a debug share on request. Environment: desktop shell 0.15.1, agent 0.16.0, commit 58ad694 (current as of 2026-06-18), Windows 11.

Operating System

Windows 11

Python Version

No response

Hermes Version

Desktop shell 0.15.1, agent 0.16.0 (commit 58ad694, current as of 2026-06-18)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

In apps/desktop/electron/main.cjs, createWindow() builds the main BrowserWindow with hardcoded width: 1220, height: 800 and there's no bounds persistence anywhere: no getBounds/setBounds save/restore, no resize/move/close listeners, and no window-bounds file written to userData. getWindowState() only tracks fullscreen + native overlay width, not size/position. App settings persist because they write their own JSON files under app.getPath('userData') (e.g. connection.json, native-theme.json); window geometry was simply never wired into that, so every launch falls back to the hardcoded default.

Proposed Fix (optional)

Persist the main window's bounds to a JSON file under app.getPath('userData') on resize/move/close (debounced) and restore them in createWindow(), falling back to the current 1220x800 default when the file is missing or the saved bounds are off-screen. The electron-window-state package handles the off-screen/multi-monitor validation if you'd rather not hand-roll it. The session windows created elsewhere in main.cjs could get the same treatment if per-window memory is wanted.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. added
    type/bugSomething isn't working
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    P3Low — cosmetic, nice to have
    duplicateThis issue or pull request already exists
    on Jun 18, 2026
  2. alt-glitch commented on Jun 18, 2026

    @alt-glitch

    Duplicate of #39101 — same bug: the desktop main window's bounds are never persisted (createWindow() in apps/desktop/electron/main.cjs hardcodes 1220x800 with no getBounds/setBounds save/restore), so it always reopens at the default size/position. Tracking under #39101; see also the feature-request framing in #38830.

  3. teknium1 commented on Jul 14, 2026

    @teknium1
    Collaborator

    Implemented on main.

    Automated hermes-sweeper review verified that the requested desktop geometry persistence is already shipped.

    • apps/desktop/electron/main.ts:2003 reads and sanitizes window-state.json; :2014 persists normal bounds and maximized state.
    • apps/desktop/electron/main.ts:7232 restores saved bounds at main-window creation; :7279 restores maximization.
    • apps/desktop/electron/main.ts:7296–:7300 saves resize/move/maximize changes and flushes on close.
    • apps/desktop/electron/window-state.ts:78–:111 rejects off-screen positions and clamps restored dimensions to available displays.
    • The behavior was added by 2de7549fe0fe06954dd7b72528ca37953d62ada1 and is included in v2026.7.1.

    This also matches the duplicate discussion linking #39101 and the already-closed #38830.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/tuiTerminal UI (ui-tui/ + tui_gateway/)duplicateThis issue or pull request already existssweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions