mirror of
https://github.com/sharkdp/bat.git
synced 2025-03-15 15:18:45 +00:00
Only enable --mouse when running from tmux, see #904
This commit is contained in:
parent
5449472f15
commit
5f6e310152
@ -100,12 +100,16 @@ impl OutputType {
|
|||||||
|
|
||||||
// Passing '--mouse' allows mouse scrolling in terminals which do not
|
// Passing '--mouse' allows mouse scrolling in terminals which do not
|
||||||
// support "fake scrolling", see https://github.com/sharkdp/bat/issues/904
|
// support "fake scrolling", see https://github.com/sharkdp/bat/issues/904
|
||||||
// The '--mouse' argument is only supported in less 551 or higher.
|
// The '--mouse' argument is only supported in less 551 or higher. We do
|
||||||
match less_version {
|
// not enable this option everywhere because it prevents users from
|
||||||
Some(version) if version >= 551 => {
|
// drag-selecting text without pressing shift.
|
||||||
p.arg("--mouse");
|
if env::var_os("TMUX").is_some() {
|
||||||
|
match less_version {
|
||||||
|
Some(version) if version >= 551 => {
|
||||||
|
p.arg("--mouse");
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p.args(args);
|
p.args(args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user