From 587633d222dc6e01e6dc793d8cd643a6f52e2e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 30 Jul 2021 09:31:48 +0200 Subject: [PATCH] playground: Set terminal title This sets the terminal title to "TiUP Playground: " 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. --- components/playground/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/playground/main.go b/components/playground/main.go index ab8f083f1e..baabd28fa7 100644 --- a/components/playground/main.go +++ b/components/playground/main.go @@ -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()