LoginSignup
0
0

More than 1 year has passed since last update.

GoでCLIを実行後にターミナルを閉じる

Last updated at Posted at 2023-02-12

やりたいこと

main.go
import "fmt"

func main() {
	fmt.Println("hello world.")
	fmt.Println("Bye bye~")
}

上記ファイルをgo buildしてできたCLIを実行すると、コマンド実行後はこのように表示される。

hello world.
Bye bye~
logout

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[プロセスが完了しました]

このCLIを実行後にターミナルウィンドウを閉じたい。

やり方

この挙動はMac自体のターミナル設定によるもので、コマンドで指定はできない。

ターミナル > 設定 と進み

プロファイルで「ウィンドウを閉じる」を選択する。

これでCLI実行後にターミナルウィンドウが閉じるようになる。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0