less somefile.txt
またはman bash
(less
内部的に使用) を実行すると、コンテンツが表示されますが、 を押すとQコンテンツが消えます。
git diff
も使用しますless
が、出力はコンソールに残ります。git
と同じように動作させるにはどうすればよいman
ですか?
現在の動作
me@mypc:~$ git diff
# I look at the diff and then press q. But it's all printed to the console
diff --git a/somefile.txt b/somefile.txt
...
...
...
me@mypc:~$
me@mypc:~$ less somefile.txt
# I look at the file content, but after I press q, console appears and nothing is printed there
me@mypc:~$
git の動作が のようなものであることに気付きました。less -X
では、そのオプションを使用せずに git の実行回数を減らすにはどうすればよいでしょうか?