Unixコマンド/stty の変更点
*&size(15){''stty''}; [#q18cc4d6]
**''機能'' [#bca12565]
sttyコマンドは、端末環境の各種パラメータを表示、設定します。~
引数なしで実行すると、sttyコマンドはデフォルトの端末環境と現在のその端末に~
設定されている環境とで、設定が異なるパラメータの内容を表示します。 ~
**''形式'' [#l9075b10]
stty [オプション] [引数]
**''オプション'' [#j71b867a]
-a 全てのパラメータについて情報を表示する
**''代表的なパラメータ'' [#me060726]
▼<通信設定>
|100|400|c
|''パラメータ''|CENTER:''意味''|h
|speed 回線速度|端末の回線速度を指定した値(2400,4800,9600)などに設定する|
|cs8|文字サイズを8ビットにする|
|parend(-parend)|パリティの生成を検出し有効にする(無効にする)|
|-parity|parendを無効にし、cs8を設定する。|
▼<画面設定>
|100|400|c
|''パラメータ''|CENTER:''意味''|h
|rows n|端末の行数をn行に指定する|
|columns n|端末の1行の桁数をn桁に設定する|
▼<キー割り当て>
|100|400|c
|''パラメータ''|CENTER:''意味''|h
|erase 制御文字|指定した機でカーソルの前の1文字消去。デフォルトは^?(「Del」)|
|intr 制御文字|指定したキーで割り込み(プログラムの実行停止)。デフォルトは^C(「Ctrl+C」)|
|werase 制御文字|指定したキーでカーソルの前の1単語消去。デフォルトは^W(「Ctrl+W」)|
|kill 制御文字|指定したキーで1行抹消。デフォルトは^U(「Ctrl+U」)|
(*)制御文字には特殊キーとの組み合わせを指定するのが一般的。~
コントロールキーとの組み合わせは、コントロールキーを[^]として表示します。~
実際に[^]キーを指定するのではありません。~
**''コマンド例'' [#r34939dc]
▼キーの割り当てを変更する
$ stty erase ^H 文字削除を([Ctrl+H])([BS])にする
$ stty 変更を確認
lflags: echoe echoke echoctl pendin
oflags: -oxtabs
cflags: cs8 -parenb
erase eraseが^Hに変更されている
^H
▼画面の表示サイズを変更する
$ stty columns 132 row 48 画面サイズを132x48に設定する
▼パリティ設定を変更する
$ stty prend パリティを有効にする
$ stty -a | grep parend
crlags: cread cs8 parend -parodd hupcl -clocal -cstopb -crtscts -dsrflow
$ stty -parend パリティを無効にする
crlags: cread cs8 -parend -parodd hupcl -clocal -cstopb -crtscts -dsrflow
▼端末の環境設定すべてを表示する
$ stty -a
speed 9600 baud; 24 rows; 132 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^H; erase2 = ^H; intr = ^C; kill = ^U;
lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;