Add window titles to various ask kitten invocations

This commit is contained in:
Kovid Goyal
2023-10-20 13:36:02 +05:30
parent 321f1a6650
commit beb18cc250
5 changed files with 28 additions and 11 deletions

View File

@@ -362,12 +362,15 @@ func GetChoices(o *Options) (response string, err error) {
if hidden_text != "" && message != "" {
message = message[:hidden_text_start_pos] + hidden_text + message[hidden_text_end_pos:]
hidden_text = ""
draw_screen()
_ = draw_screen()
}
}
lp.OnInitialize = func() (string, error) {
lp.SetCursorVisible(false)
if o.Title != "" {
lp.SetWindowTitle(o.Title)
}
return "", draw_screen()
}

View File

@@ -30,6 +30,11 @@ The name for this question. Used to store history of previous answers which can
be used for completions and via the browse history readline bindings.
--title --window-title
The title for the window in which the question is displayed. Only implemented
for yesno and choices types.
--choice -c
type=list
dest=choices

View File

@@ -129,6 +129,7 @@ func Run(args []string) (rc int, err error) {
}
lp.OnInitialize = func() (string, error) {
lp.SetWindowTitle("kitty mouse features demo")
lp.SetCursorVisible(false)
draw_screen()
return "", nil