diff options
| author | Jeff Carr <[email protected]> | 2025-10-09 21:32:06 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-09 21:32:06 -0500 |
| commit | ee47b39efae2347e5ee3fff2888a008d4848276b (patch) | |
| tree | d3d553f3df83eaa16111137e220b0a4a7b0b029c /setTerminalTitle.go | |
| parent | 43932185ea487ec922d3e4a50625b6de22358c2a (diff) | |
set the terminal titlev0.25.75
Diffstat (limited to 'setTerminalTitle.go')
| -rw-r--r-- | setTerminalTitle.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/setTerminalTitle.go b/setTerminalTitle.go new file mode 100644 index 0000000..a39e386 --- /dev/null +++ b/setTerminalTitle.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" +) + +// setTitle prints the escape sequence to change the terminal title. +func setTerminalTitle(title string) { + fmt.Printf("\033]2;%s\007", title) +} + +// resetTitle prints the escape sequence to clear the title. +// Most terminals will revert to their default profile title. +func resetTerminalTitle() { + fmt.Printf("\033]2;\007") +} |
