-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__fish_print_help invokes less
in a somewhat annoying way (on macOS + iTerm)
#7997
Comments
Wait... what kind of "pager scrolling"? Just the keybinding stuff? Up or down-arrow or j or k? That sort of thing? Or mouse? The tricky thing here is that we absolutely want at the very least We could probably also change Or allowing the user's $LESS to be used, but that would mean you might not have -F. |
Sorry, mouse wheel scrolling. Instead, it scrolls the whole shell window.
Yeah, italics still work on mac with -R. This doesn't fix my issue tho, fwiw, its just something I noticed when investigating. |
Alright, the comment says we don't actually know why we're using -X and I can't see a reason for it (it's not like less has a massive config file that could break anything here). So I've removed it, and allowed $LESS to take precedence. I've also switched to -R - less really wants that one, so that's what it gets. |
Looks good, except that we used to include @thomcc Does removing EDIT: nevermind, not overriding $LESS is what Git does, so we should probably follow. |
Yes. |
__fish_print_help
doesn't support whatever control codes normally are used to make pager scrolling work. This is because of theX
flag set here: https://github.com/fish-shell/fish-shell/blob/master/share/functions/__fish_print_help.fish#L122. If I unset that flag from there, everything works fine.Git used to have the same issue for me, and I had to set
core.pager
to something that includesless -R
, and I've also had to setLESS=-R
in my environment for... well, I don't actually remember which one that was for. Honestly, it might have been for fish (it looks like you respect$LESS
if it's set here, although I'm not sure I've ever invokedhistory
).So I guess one resolution is just to respect the value for
$LESS
. It also seems like setting PAGER toless -R
in the env doesn't work either, but maybe that's intentional (I guess there's some tokenizing).Also, the main case this prints out is for stuff like
string --help
, and honestly I'd be totally fine without invoking the pager for that, even if it's a bit long. That said, I don't really care, I just want scrolling to work if the pager is invoked.FWIW while this may be misconfiguration on my system (truly I don't know, it seems likely this is caused by something weird in my terminfo), I also believe that it's a "stock" misconfiguration — I've never customized my terminfo or $TERM value. So, I think it's caused by an interaction between iTerm2 and the terminfo that's provided on macOS for xterm-256color. (I've tried it on a machine that hasn't had nearly the amount of customization that this one has, and it still shows the issue)
Other relevant versions: macOS Big Sur 11.3, in iTerm2 3.4.5beta3, although I've had this issue with other programs in the past and don't think it's related to using iTerm2 beta. I also updated
less
to check if the issue persisted, but I updated fish as well, and no longer know what the terminal version is.I've confirmed the issue happens on a fresh shell with a mktemp config dir.
P.S. while filing this issue I noticed that we're using
-r
here, and not-R
fish-shell/share/functions/__fish_print_help.fish
Line 126 in bcbfd70
man less
goes out of its way to say to use -R for stuff like styling — note that while it only mentions colors, I can confirm that with -RCopypaste from `man less` about the -R vs -r flag
The text was updated successfully, but these errors were encountered: