i3 / i3/i3

Lack of state recovery upon miswritten config file

Open
#4,422 6 comments 0 reactions 0 assignees View on GitHub
4.19 bug reproducible
Dominant language
C
Stars
10.6k
Forks
822
PR merge metrics
No merged PRs in 30d

Description

## I'm submitting a…

[x] Bug

[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

## Current Behavior
Upon reload, i3 does not appear to attempt to recover its state if the configuration file has errors.

## Expected Behavior
I3 should save the settings listed in the config file in a separate memory buffer, and only apply them if there is no errors, or dump them if there are

## Reproduction Instructions
1. Introduce a miswritten entry, eg. :
```conf
set $chres resolution: (1) 720p, (2) 1080p
mode $chres { # <-- ERROR: "$chres# has to be in quotes
bindsym 1 exec --no-startup-id "xrandr --output VGA1 --mode 1280x720", mode "default"
bindsym 2 exec --no-startup-id "xrandr --output VGA1 --mode 1920x1080", mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
}

bindsym $mod+u mode $chres

```
2. Press $mod+Shift+c, or reload i3 in any other way

3. Observe that i3 will not be responsive to the `Enter` and `Escape` keystrokes, albeit this can be partially worked around, say by combining it with `Ctrl` key
## Environment

Output of `i3 --moreversion 2>&-`:

i3 version: 


```
Binary i3 version: 4.19.2 (2021-02-27) © 2009 Michael Stapelberg and contributors
(Getting version from running i3, press ctrl-c to abort…)
Running i3 version: 4.19.2 (2021-02-27) (pid 1917)
Loaded i3 config: /home/mlerp/.config/i3/config (Last modified: Fri 14 May 2021 09:30:52 PM CEST, 324 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3-with-/i3
```

Config file:
[~/.config/i3/config](https://github.com/i3/i3/files/6480892/config.txt)

- Linux Distribution & Version: linux-5.12.3.arch1-1

- Are you using a compositor (e.g., xcompmgr or compton): no

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.