Support window title

This commit is contained in:
Kovid Goyal
2025-07-03 09:08:19 +05:30
parent ee13908ff1
commit 28b2f0c819
3 changed files with 22 additions and 12 deletions

View File

@@ -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) {

View File

@@ -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.

View File

@@ -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