Moar modifies prompt characters
I tried out moar in (void) linux console with moar hello.sh and for some reason it modifies the characters of the prompt:
Interestingly
eza or lsresets the prompt characters.
For curiosity, I tried out bat with moar as pager I also get a similar but different prompt character modification:
In console
eza or ls resets the characters.
For bat export BAT_PAGER='moar -no-linenumbers -quit-if-one-screen .
The latter moar bat behaviour is also present in simple terminal:
However only
eza resets the character.
For the same use cases, less do not present these behaviours.
On windows 10 and 11, in the latest WezTerm, I experience the same behaviour with bat, when the content is smaller than one screen.
- Can you do
moar --trace hello.sh, reproduce the problem and post the trace output here? - What terminal are you using when you reproduce this?
- How do you exit
moar? By pressingq? PressingESC? Something else?
- Can you do
moar --trace hello.sh, reproduce the problem and post the trace output here?
The result of moar --trace hello.sh :
- What terminal are you using when you reproduce this?
I made the first and second image in my description, in the default linux console of Void Linux (base 2024-03-14) . I made third image was in the suckless Simple Terminal . I also made the above image in the default linux console .
- How do you exit
moar? By pressingq? PressingESC? Something else?
I used the 'q' button. Though trying the 'ESC' also yields the same result.
I made the first and second image in my description, in the default linux console of Void Linux (base 2024-03-14)
I downloaded void-live-x86_64-20240314-xfce.iso and launched it in Virtualbox.
Then I started the default (XFCE) terminal and made a hello.sh script like yours.
I opened that in moar v1.28.2. When I press q, the terminal gets restored to the state it had before I launched moar, so no repro.
I then tried xbps-install st and tried the same thing in st.
Same thing though, no repro.
So the question now is how your system is different from mine?
Here's my hello.sh:
#!/bin/bash
echo "hello world!"
- Are you running something like tmux, screen or ct that could affect moar's behavior?
- Do you have any terminal settings that could affect moar's behavior?
In your image (see below), moar exits, but moar's UI is still there right before the prompt.
This is weird, since moar uses the Alternative Screen for all its drawing. When moar exits it switches back.
Switching back should at least make moar's UI disappear before moar terminates.
If the alternate screen implementation in the terminals where you reproduced this was broken, that could explain it, but:
- You tried with two different terminals. Both of them failing to implement altscreen seems unlikely.
- I tried with the same terminals, and the problems didn't appear for me
- Are you running something like tmux, screen or ct that could affect moar's behavior?
- Do you have any terminal settings that could affect moar's behavior?
In your image (see below), moar exits, but moar's UI is still there right before the prompt.
This is weird, since moar uses the Alternative Screen for all its drawing. When moar exits it switches back.
Switching back should at least make moar's UI disappear before moar terminates.
If the alternate screen implementation in the terminals where you reproduced this was broken, that could explain it, but:
- You tried with two different terminals. Both of them failing to implement altscreen seems unlikely.
- I tried with the same terminals, and the problems didn't appear for me
No, my setup for the first bug is the simplest possible:
- I downloaded the void live
image void-live-x86_64-20240314-base.iso. - I started it on a Qemu virtual machine.
- I synchronised the xbps repository index.
- I installed
moarand used it on a file. - I did not use anything apart from the vanilla linux console (no tmux, no screen, no ct, no xorg, no wayland, no etc..) to view a file with
moar!
The second bug requires bat and the presence of
export BAT_PAGER='moar -no-linenumbers -quit-if-one-screen'
environment variable. It is also reproducible with the pure base void live image if moar, bat is installed and BAT_PAGER environment variable is set. This can be induced by viewing a file with bat like bat hello.sh .
However, unlike the first bug, it is reproducible outside the linux console. So far I reproduced it in st and WezTerm. Here is the reproduction of the bug with bat on Windows 11 (Powershell 7.4.6), in WezTerm (wezterm 20240203-110809-5046fc22):
