mirror of
https://github.com/sharkdp/bat
synced 2024-11-27 22:30:33 +00:00
Only enable --mouse when running from tmux, see #904
This commit is contained in:
parent
5449472f15
commit
5f6e310152
1 changed files with 9 additions and 5 deletions
|
@ -100,12 +100,16 @@ impl OutputType {
|
|||
|
||||
// Passing '--mouse' allows mouse scrolling in terminals which do not
|
||||
// support "fake scrolling", see https://github.com/sharkdp/bat/issues/904
|
||||
// The '--mouse' argument is only supported in less 551 or higher.
|
||||
match less_version {
|
||||
Some(version) if version >= 551 => {
|
||||
p.arg("--mouse");
|
||||
// The '--mouse' argument is only supported in less 551 or higher. We do
|
||||
// not enable this option everywhere because it prevents users from
|
||||
// drag-selecting text without pressing shift.
|
||||
if env::var_os("TMUX").is_some() {
|
||||
match less_version {
|
||||
Some(version) if version >= 551 => {
|
||||
p.arg("--mouse");
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
} else {
|
||||
p.args(args);
|
||||
|
|
Loading…
Reference in a new issue