Repository navigation
Closed
Description
Description
Describe the bug
The .window-state.json file is always reset to default values when OpenCode Desktop launches. Custom window size and position settings are not persisted.
Steps to reproduce
- Launch OpenCode Desktop
- Resize and reposition the window
- Close OpenCode Desktop completely
- Check
~/.config/ai.opencode.desktop.dev/.window-state.json- custom values are saved - Launch OpenCode Desktop again
- Window opens with default size (800x600, maximized: true)
- Check
.window-state.json- values are reset to defaults:
{
"main": {
"width": 800,
"height": 600,
"x": 80,
"y": 0,
"prev_x": 80,
"prev_y": 0,
"maximized": true,
"visible": true,
"decorated": true,
"fullscreen": false
}
}Display: 4K (3840x2160) with 125% scaling
Config path: ~/.config/ai.opencode.desktop.dev/.window-state.json
Expected behavior
Window size and position should persist across sessions. The .window-state.json values should be read and applied on launch.
Actual behavior
Window state is reset to hardcoded defaults on every launch, ignoring .window-state.json.
Additional context
This may be related to Tauri's window-state plugin not correctly reading the saved state file, or the state being overwritten before the window is created.
Plugins
No response
OpenCode version
1.2.14
Steps to reproduce
- Close OpenCode Desktop completely (ensure no process is running)
- Launch OpenCode Desktop
- Resize the window to a custom size (e.g., drag to make it 1400x900)
- Move the window to a different position
- Unmaximize the window if it was maximized
- Close OpenCode Desktop
- Open
~/.config/ai.opencode.desktop.dev/.window-state.jsonand verify custom values are saved:{ "main": { "width": 1400, "height": 900, "x": 836, "y": 414, "maximized": false, ... } } - Launch OpenCode Desktop again
- Observe: Window opens maximized at default size (800x600)
- Check ~/.config/ai.opencode.desktop.dev/.window-state.json again
- Observe: File content is reset to defaults:
{
"main": {
"width": 800,
"height": 600,
"x": 80,
"y": 0,
"prev_x": 80,
"prev_y": 0,
"maximized": true,
"visible": true,
"decorated": true,
"fullscreen": false
}
}Screenshot and/or share link
No response
Operating System
openSUSE Leap 15.6 / 16, SUSE Linux Enterprise 15 SP6, SP7
Terminal
No response
Metadata
Metadata
Assignees
Labels
No labels
Activity
jfseaman commentedon Feb 27, 2026
Solution for maintainer.
for 1.2.15 at line 60 of windows.rs there is an explicit .maximized(true)
Remove this and the application will start in the the same state it was last closed.
Justification, that is what every other application does so it is standard.
jfseaman commentedon Feb 27, 2026
For Windows the proposed fix also has the benefit of fixing the creation of the mainwindow maximized then resized. Instead it is created the appropriate size. Less "flashing". Less "mess".
jfseaman commentedon Apr 3, 2026
This bug exists for all version to current.
It is annoying as heck that the Linux build behaves different from every other application on the planet.
The app should start in the same state it was when last closed. That is the behavior of all other environments. It is the standard.
It is a one line change at line 60 of windows.rs.
jfseaman commentedon Apr 4, 2026
It's a one line change to packages/desktop/src-tauri/src/windows.rs at line 60.
Just comment it out.
I have built and tested it on every platform except Apple silicon which does not have the issue.
It only affects Linux builds.