mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-20 02:57:19 +03:00
Fix #5761
This commit is contained in:
parent
b6c6316b7b
commit
95e05ce9ec
@ -28,7 +28,7 @@ class SetTabTitle(RemoteCommand):
|
||||
' title of the currently active window in the tab is used.'
|
||||
)
|
||||
options_spec = MATCH_TAB_OPTION
|
||||
args = RemoteCommand.Args(spec='TITLE ...', json_field='title')
|
||||
args = RemoteCommand.Args(spec='TITLE ...', json_field='title', special_parse='expand_ansi_c_escapes_in_args(args...)')
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
return {'title': ' '.join(args), 'match': opts.match}
|
||||
|
@ -33,7 +33,7 @@ class SetWindowTitle(RemoteCommand):
|
||||
By default, the title will be permanently changed and programs running in the window will not be able to change it
|
||||
again. If you want to allow other programs to change it afterwards, use this option.
|
||||
''' + '\n\n' + MATCH_WINDOW_OPTION
|
||||
args = RemoteCommand.Args(json_field='title', spec='[TITLE ...]')
|
||||
args = RemoteCommand.Args(json_field='title', spec='[TITLE ...]', special_parse='expand_ansi_c_escapes_in_args(args...)')
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
ans = {'match': opts.match, 'temporary': opts.temporary}
|
||||
|
@ -22,6 +22,7 @@ import (
|
||||
"kitty/tools/tui"
|
||||
"kitty/tools/tui/loop"
|
||||
"kitty/tools/utils"
|
||||
"kitty/tools/utils/shlex"
|
||||
|
||||
"github.com/jamesruan/go-rfc1924/base85"
|
||||
)
|
||||
@ -35,6 +36,13 @@ type GlobalOptions struct {
|
||||
|
||||
var global_options GlobalOptions
|
||||
|
||||
func expand_ansi_c_escapes_in_args(args ...string) (string, error) {
|
||||
for i, x := range args {
|
||||
args[i] = shlex.ExpandANSICEscapes(x)
|
||||
}
|
||||
return strings.Join(args, " "), nil
|
||||
}
|
||||
|
||||
func set_payload_string_field(io_data *rc_io_data, field, data string) {
|
||||
payload_interface := reflect.ValueOf(&io_data.rc.Payload).Elem()
|
||||
struct_in_interface := reflect.New(payload_interface.Elem().Type()).Elem()
|
||||
|
Loading…
Reference in New Issue
Block a user