From 28b2f0c819f0ac5994254b7b8c0b8f40ef40933a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Jul 2025 09:08:19 +0530 Subject: [PATCH] Support window title --- kittens/choose_files/main.go | 3 +++ kittens/choose_files/main.py | 28 ++++++++++++++++------------ kittens/desktop_ui/portal.go | 3 +++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/kittens/choose_files/main.go b/kittens/choose_files/main.go index b716a10d5..a37484fae 100644 --- a/kittens/choose_files/main.go +++ b/kittens/choose_files/main.go @@ -482,6 +482,9 @@ func main(_ *cli.Command, opts *Options, args []string) (rc int, err error) { return "", err } } + if opts.Title != "" { + lp.SetWindowTitle(opts.Title) + } return handler.OnInitialize() } lp.OnResize = func(old, new_size loop.ScreenSize) (err error) { diff --git a/kittens/choose_files/main.py b/kittens/choose_files/main.py index 7aac2f682..2a5235604 100644 --- a/kittens/choose_files/main.py +++ b/kittens/choose_files/main.py @@ -25,18 +25,6 @@ usage = '[directory to start choosing files in]' OPTIONS = ''' ---override -o -type=list -Override individual configuration options, can be specified multiple times. -Syntax: :italic:`name=value`. - - ---config -type=list -completion=type:file ext:conf group:"Config files" kwds:none,NONE -{config_help} - - --mode type=choices choices=file,files,save-file,dir,save-dir,dirs,save-files @@ -52,6 +40,22 @@ A suggested name when picking a save file. Path to an existing file to use as the save file. +--title +Window title to use for this chooser + + +--override -o +type=list +Override individual configuration options, can be specified multiple times. +Syntax: :italic:`name=value`. + + +--config +type=list +completion=type:file ext:conf group:"Config files" kwds:none,NONE +{config_help} + + --write-output-to Path to a file to which the output is written in addition to STDOUT. diff --git a/kittens/desktop_ui/portal.go b/kittens/desktop_ui/portal.go index aa463dc87..1c122c556 100644 --- a/kittens/desktop_ui/portal.go +++ b/kittens/desktop_ui/portal.go @@ -748,6 +748,9 @@ func (self *Portal) run_file_chooser(cfd ChooseFilesData) (response uint32, resu if cfd.SuggestedSaveFilePath != "" { args = append(args, `--suggested-save-file-path`, cfd.SuggestedSaveFilePath) } + if cfd.Title != "" { + args = append(args, "--title", cfd.Title) + } args = append(args, "--write-pid-to", pid_path) cmd := exec.Command(utils.KittyExe(), args...) cmd.Dir = cfd.Cwd