kovidgoyal/kitty · error
Bad config lines: %s with error: %s
Error message
Bad config lines: %s with error: %s
What it means
In the SSH kitten's self-test, load_config parsed a config file successfully but reported bad (unparseable) lines; the first bad line's content and parse error are reported. This mirrors real config-file syntax errors in ssh kitten config files.
Source
Thrown at kittens/ssh/main.go:912
return 1, err
}
defer func() {
f.Close()
os.Remove(f.Name())
}()
_, err = io.Copy(f, os.Stdin)
if err != nil {
return 1, err
}
cd := &connection_data{
request_id: "testing", remote_args: []string{},
username: "testuser", hostname_for_match: "host.test", request_data: true,
test_script: args[0], echo_on: true,
}
opts, bad_lines, err := load_config(cd.hostname_for_match, cd.username, nil, f.Name())
if err == nil {
if len(bad_lines) > 0 {
return 1, fmt.Errorf("Bad config lines: %s with error: %s", bad_lines[0].Line, bad_lines[0].Err)
}
cd.host_opts = opts
err = get_remote_command(cd)
}
if err != nil {
return 1, err
}
data, err := json.Marshal(map[string]any{"cmd": cd.rcmd, "shm_name": cd.shm_name})
if err == nil {
_, err = os.Stdout.Write(data)
os.Stdout.Close()
}
if err != nil {
return 1, err
}
return
}View on GitHub (pinned to 6d5d0c4406)
Solutions
- Fix or remove the reported line in the config file (the error prints the exact line and reason)
- Check option spelling against the kitty docs for your kitty version
- Validate config after upgrades — option names change between kitty releases
Example fix
# before (ssh.conf) share_cnx yes # after share_connections yes
Defensive patterns
Strategy: validation
Validate before calling
kitty +kitten ssh --config-file /dev/null host # bypass suspicious config to isolate kitty +runpy 'from kittens.ssh.config import load_config' # smoke-test config loading
Prevention
- Re-check ssh.conf syntax after kitty upgrades
- Keep config minimal and version-controlled so bad lines are easy to spot
When it happens
Trigger: load_config() returns err == nil but bad_lines is non-empty — a config file contains a line with invalid syntax or an unknown option.
Common situations: Typos in ~/.config/kitty/ssh.conf or per-host INCLUDEd files; options from a newer/older kitty version; copy-pasted config with stray characters.
Related errors
- Cannot use forward_remote_control=yes without share_connecti
- This should be run as kitten broadcast
- This should be run as kitten ssh
- Incorrect owner on pwfile: uid={shm.stats.st_uid} gid={shm.s
- Incorrect permissions on pwfile: 0o{mode:03o}
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/53cb5b98e159e715.
Report an issue: GitHub.