{"record":{"id":"2361e71aef6e1b41","repo":"kovidgoyal/kitty","slug":"the-settings-did-not-come-from-the-desktop-ui-kitt","errorCode":null,"errorMessage":"the settings did not come from the desktop-ui kitten. Some other portal backend is providing the service.","messagePattern":"the settings did not come from the desktop-ui kitten\\. Some other portal backend is providing the service\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kittens/desktop_ui/portal.go","lineNumber":310,"sourceCode":"\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to format the response as JSON: %w\", err)\n\t\t}\n\t\tfmt.Println(string(j))\n\t} else {\n\t\tfor ns, m := range response {\n\t\t\tfmt.Println(ns + \":\")\n\t\t\tfor key, v := range m {\n\t\t\t\tfmt.Printf(\"\\t%s: %s\\n\", key, v)\n\t\t\t}\n\t\t}\n\t}\n\tif !opts.AllowOtherBackends {\n\t\tis_running_self := false\n\t\tif m, found := response[SETTINGS_CANARY_NAMESPACE]; found {\n\t\t\t_, is_running_self = m[SETTINGS_CANARY_KEY]\n\t\t}\n\t\tif !is_running_self {\n\t\t\terr = fmt.Errorf(\"the settings did not come from the desktop-ui kitten. Some other portal backend is providing the service.\")\n\t\t}\n\t}\n\treturn\n}\n\nvar DataDirs = sync.OnceValue(func() (ans []string) {\n\t// $XDG_DATA_DIRS defines the preference-ordered set of base directories\n\t// to search for data files **in addition to the $XDG_DATA_HOME** base\n\t// directory. The directories in $XDG_DATA_DIRS should be separated with\n\t// a colon ':'.\n\t// https://specifications.freedesktop.org/basedir-spec/0.8/#variables\n\n\tdata_dirs := os.Getenv(\"XDG_DATA_DIRS\")\n\tif data_dirs == \"\" {\n\t\tdata_dirs = \"/usr/local/share:/usr/share\"\n\t}\n\tdata_home := os.Getenv(\"XDG_DATA_HOME\")\n\tif data_home == \"\" {","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/desktop_ui/portal.go#L292-L328","documentation":"show_settings verifies a canary namespace/key pair (SETTINGS_CANARY_NAMESPACE/KEY) that only the kitty desktop-ui portal itself sets. If absent, another portal backend (GNOME/KDE's) is servicing the ReadAll call, and without --allow-other-backends the command refuses to continue.","triggerScenarios":"Running show-settings while the desktop portal service is provided by the desktop environment's own backend instead of the kitty kitten portal.","commonSituations":"kitten desktop-ui enable never run or the portal not restarted after enabling; a full desktop environment (GNOME/KDE) whose portal takes precedence; reading settings on a machine where only the DE backend exists.","solutions":["Pass --allow-other-backends if you intentionally want to read another backend's settings","Run `kitten desktop-ui enable` and restart xdg-desktop-portal so the kitty backend is registered and selected","Check portal backend selection with busctl --user to confirm which impl is active"],"exampleFix":"# before\nkitten desktop-ui show-settings\n# after\nkitten desktop-ui show-settings --allow-other-backends","handlingStrategy":"fallback","validationCode":"// detect kitty backend before relying on settings\nresp, _ := fetchSettings(conn, SETTINGS_CANARY_NAMESPACE)\nif _, ok := resp[SETTINGS_CANARY_KEY]; !ok {\n    // use --allow-other-backends path\n}","typeGuard":"func isKittyBackend(resp ReadAllType) bool {\n    m, ok := resp[SETTINGS_CANARY_NAMESPACE]\n    if !ok { return false }\n    _, ok = m[SETTINGS_CANARY_KEY]\n    return ok\n}","tryCatchPattern":"if err := showSettings(opts); err != nil {\n    if strings.Contains(err.Error(), \"Some other portal backend\") {\n        opts.AllowOtherBackends = true\n        err = showSettings(opts)\n    }\n}","preventionTips":["Run `kitten desktop-ui enable` and restart the portal on new setups","Pass --allow-other-backends when intentionally querying DE backends"],"tags":["dbus","xdg-desktop-portal","desktop-ui","backend-selection"],"backgroundTag":"portal-wrong-backend","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}