Skip to content

Change the title of the currently running terminal emulator

License

Notifications You must be signed in to change notification settings

xyproto/termtitle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terminal Title

Change the title if the currently running terminal emulator supports it.

Currently supported terminal emulators

  • konsole
  • alacritty
  • gnome-terminal

For unsupported terminal emulators, the MustSet function will try the same terminal codes as for gnome-terminal.

Example use

package main

import (
    "github.com/xyproto/termtitle"
)

func main() {
    termtitle.Set("TESTING 1 2 3")
}

Terminal codes

For konsole a working string seems to be:

\033]0;TITLE\a

While for gnome-terminal, this one works:

\033]30;TITLE\007

For alacritty, this seems to work:

\033]2;TITLE\007

TITLE is the title that will be set.

The settitle utility

This utility can be used for setting the terminal title.

Install with Go 1.18 or later:

go install github.com/xyproto/termtitle/cmd/settitle@latest

General info

About

Change the title of the currently running terminal emulator

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages