0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Mac 広げてしまったターミナルのウインドウサイズを一発で戻すコマンド

Last updated at Posted at 2024-01-18



見易くするために、マウスドラッグでウインドウを広げるときがあります。そんな時、

そのターミナルで 次のコマンドを叩く

# resize to 80x24
echo '\e[8;24;80t' 
または
printf '\e[8;24;80t' 

echo , printfどちらも、zshの組み込みコマンドです)

24行、80列の数値を書き換えると、任意のサイズに変更できます。


alias仕込んでおくと便利。

alias reset_size="echo '\e[8;24;80t'"  

そもそものデフォルトのウインドウサイズを変更する場合は

「ターミナル」メニュー → 「設定...」 →「ウインドウ」タブにあるウインドサイズのを変更します。

最大サイズは?

当方の WQHD(2560×1440)のモニターで ターミナル ウインドウを最大限広げると、317列×81行となりました。

macOS以外でも

ANSIエスケープシーケンスであるため、Unix, Linux系OSなら使えると思いますが、echoコマンドに-eオプションが必要な場合があります。BSD / SystemV系の違いか、シェルの違いか??

echo -e '\e[8;24;80t'

WindowsOSのコマンドプロンプトでは、使えないっぽい。



以上

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?