mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
Set window title when showing errors
This commit is contained in:
@@ -404,10 +404,13 @@ func (self *Loop) AllowLineWrapping(allow bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func EscapeCodeToSetWindowTitle(title string) string {
|
||||
title = wcswidth.StripEscapeCodes(title)
|
||||
return "\033]2;" + title + "\033\\"
|
||||
}
|
||||
|
||||
func (self *Loop) SetWindowTitle(title string) {
|
||||
title = strings.ReplaceAll(title, "\033", "")
|
||||
title = strings.ReplaceAll(title, "\x9c", "")
|
||||
self.QueueWriteString("\033]2;" + title + "\033\\")
|
||||
self.QueueWriteString(EscapeCodeToSetWindowTitle(title))
|
||||
}
|
||||
|
||||
func (self *Loop) ClearScreen() {
|
||||
|
||||
Reference in New Issue
Block a user