-
Notifications
You must be signed in to change notification settings - Fork 343
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
CLI --help font or character format trouble when PAGER=less and LESS is unset (Alpine/Gentoo/NixOS default) #4745
Comments
Perhaps you are using Separately, it seems that Update: You can also use |
Yes, |
It might be You should look at whether you have One config that should work is to set If you also want mouse scrolling (which has some downsides) and a different status bar, my actual config is |
I'd also appreciate knowing what these things are currently set to for you, and why (is that your config or Alpine's?). I'm wondering if we can add something about this in the FAQ. It often happens on Windows. |
I just installed (clean) from APK (Alpine Package Keeper), and typed I think if one needs to do configuration for JJ cli help, it may be doing too much on the formatting end haha. If I want to scroll through long docs, I will do it in a browser, though all for local docs, just think that the default cli help should not require formatting on any platform. I also use many tools built with clap, and this is first time I am seeing anything like this. |
Yeah, I might try it with an Alpine VM one day (never used it, but hopefully it's not too hard to run). I'm currently not sure what In any case, I appreciate the report! Good to know that something weird is going on with jj and Alpine. |
Can you post the output of Update: Edited, had a bug before. |
I frankly don't understand why Less is being used at all for cli help. Why would you be displaying the contents of a file instead of building the help out through clap? This is the fist time I am seeing anything like this, and it is frankly very annoying on the UX aspect. The output states: less
less |
I would expect to be able to transition through cli help at every step of the command, not just read some file: e.g. |
ignore last statement, seems I can get that level of help still, but it is just feels weird relative to all other cli help. The needing to exit instead of just remaining on cli is odd to me. |
Thanks! Setting We are building the help with clap. It gets long sometimes, e.g. As you observed, this is not a perfect approach in all cases. Again, it's a lot better with It turns out to not be easy to make this work well for 100% of configs out of the box, but we'll do better if we can. |
I think you can also set #836 is related. I am not sure why it's not working for you, actually. |
But the need to page is the off design choice for cli-help to me. You could always link to longer format more comfortable local or remote docs for long form info. I come to cli for quick information, and to remember commands. Is the paging necessary because you want to show all commands and options through cli help? |
Do you configure |
Clap's convention is to have |
I don't even know what ui.pager is yet, that is the whole point. Or where the config.toml is for this, assuming ~/.config/jj. If help is supposed to be the first command that people may run, it shouldn't have any risk of requiring configuration to view it cleanly. |
I am doing |
I am very confused why your This is worth investigating, any help Alpine people can provide is welcome. Or I might run a VM one day. It's an interesting FR to have You are correct that paging by default is not a The config would be at |
FWIW, |
I am not an Alpine person (but it is my chosen distro right now haha), but I do appreciate the discussion and help still, and will do my best to give feedback. Update: Config was empty in XDG_CONFIG_HOME, but setting Is the config.toml supposed to be empty on clean install? |
Yes, but I don't have this issue with |
Yes.
You mean |
I mean The capital "LESS" mattered, lowercase did not work. "less -FRX" also works |
OK, I started a VM and I can reproduce this. Does Does setting I still don't understand why there is no effect from https://github.com/martinvonz/jj/blob/91f869c32a7f2fc374c79205a2d43ff1ca1c991c/cli/src/config/misc.toml#L23 . I get: $ jj config list ui |cat
ui.pager="less" Update: Maybe it's just because Alpine sets Update 2: Yes, this is the problem. |
Yes, by default most tools and utils on Alpine are busybox, and it uses openrc by default which is why I decided to give it a go. I have not used or configured less much so I am ignorant in what sane values would be or even this tool honestly. I can create an issue there also, I am in process of setting up environments for daily driving with Alpine, and this would be good to know there if it will affect others. |
I think I have a fix in mind. We can ignore This might only solve 95% of the problem for you unless you Update: Not sure whether we want to detect the case of |
Problem was solved for me the moment you told me about ui.pager option for config.toml, and now I understand LESS, MORE hehe. Mainly created this issue to deliver ux feedback in case it was valid. Thanks so much @ilyagr |
Another possibility would be to file an FR/merge request for https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/alpine-baselayout/profile to add
Update: Actually, I can. If we implemented a workaround as in #4745 (comment), setting LESS to R would break it. |
I don't think the best solution is individual PRs to distros yet, in case Gentoo and other busybox based distros also do similar. May be worth checking Gentoo quickly to see what is up there. https://github.com/gentoo/baselayout/blob/9f217ba38e0cd0e91e69de5f1f36a0cca682cc4b/etc/profile#L16 |
I'll change the title again, since Busybox Less is not a problem here, it's the default #3657 is also closely related. |
I don't know of it is only related to Gentoo or Alpine defaults, I haven't looked at every distribution that uses Busybox's Less, and viewed their defaul profile. The issue should still be related to busybox less, because you are making assumptions of how paging is handled, and it requires non-default less options which no other tool I have used on busybox or gnu less requires. This is the first tool I have ever experienced this with. It leads me to believe JJ is the outlier, not Alpine or Gentoo defaults for profile. |
By the way, thank you for checking on Gentoo's config! It's helpful to know that Alpine is not the only example. You're probably right that changing their config is not the answer then. I'm not saying this is only the default in Gentoo and Alpine. "More than one distribution" is probably enough info for me. |
I'm also getting this issue in NixOS |
@purepani , just to double-check, can you run |
|
It is also fixed by the env var solutions above(setting |
You don't need both, either of them should be sufficient by itself. I recommend Detail: For a few programs (e.g. |
Yeah I meant both of those individually not together sorry about that haha. |
As a reference point for someone new to jj: I have never had this issue with git so In the short term one thing that would help is editing this issue so that the solution ( Git must be doing some kind of detection for this issue? |
Description
When launching the jj help on cli, the help doesn't appear correct - seems like it has character representations, but I can't determine if these are ascii, utf, or unicode character representation, it doesn't seem to map to tables I have tried to search through?
Redirecting output to a file makes it readable, other tools cli help don't have same issue, and I have tried different terminals and fonts. Not sure what could be causing this, and it may just be on my end.
Steps to Reproduce the Problem
Expected Behavior
The help looks normal, as it does when redirected to a file and opened
Actual Behavior
Will display correctly if I redirect output to a file. I have tried several fonts including system defaults.
The output in terminal looks like this:
Specifications
The text was updated successfully, but these errors were encountered: