1

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 の実行回数を減らすにはどうすればよいでしょうか?

4

1 に答える 1