Mercurial 并排差异(最大术语宽度)

Mercurial side-by-side diffs (at max term width)

我在 ~/.hgrc...

中使用 extdiff
[extensions]
pager =
hgext.extdiff =

[extdiff]
# add new command that runs GNU diff(1) in 'side-by-side' mode
cmd.sdiff = sh
opts.sdiff = -c 'diff -dbB --left-column -y -W `tput cols` [=10=] '

[pager]
pager = LESS='FRX' less
attend = cat, diff, sdiff, glog, log, incoming, outgoing, lg, show, lga

这意味着我可以使用 hg sdiff README 并在 side-by-side mode 中使用 diff 作为 README 文件;但是,出于某种原因,当我通过 hg sdiff.

运行 时,上面 tput cols 的输出仍然给出 shell 80 个字符

如果我从 [pager] 扩展中删除 sdiff,我的 sdiff 将跨越整个终端宽度...

[pager]
pager = LESS='FRX' less
## Removing sdiff fixes the problem with terminal width
attend = cat, diff, glog, log, incoming, outgoing, lg, show, lga

即使我从 [pager] 部分中删除 sdiff 并手动通过 less 作为 hg sdiff | less -FRX,差异仍然跨越整个终端宽度。如何获得 [extdiff][pager] 以允许动态终端宽度用于并排差异?

我找到的唯一解决方法是

[extdiff]
# add new command that runs GNU diff(1) in 'side-by-side' mode
cmd.sdiff = sh
opts.sdiff = -c 'diff -dbB --left-column -y -W `tput cols` [=10=]  | less -FRX'

我还从 [pager] 部分删除了 sdiff。这看起来像是一个 Mercurial 错误。