Skip to content

Commit

Permalink
playground: Set terminal title
Browse files Browse the repository at this point in the history
This sets the terminal title to "TiUP Playground: <name>" where name
is the last part of the datadir. With `tiup -T foobar playground` etc.
this name can be set. Also `tiup client` uses the same names.
  • Loading branch information
dveeden committed Jul 30, 2021
1 parent 537aacb commit 587633d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/playground/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,9 @@ func newEtcdClient(endpoint string) (*clientv3.Client, error) {
}

func main() {
dataDir := os.Getenv(localdata.EnvNameInstanceDataDir)
instanceName := dataDir[strings.LastIndex(dataDir, "/")+1:]
fmt.Printf("\033]0;TiUP Playground: %s\a", instanceName)
start := time.Now()
code := 0
err := execute()
Expand Down

0 comments on commit 587633d

Please sign in to comment.