walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
600 stars 17 forks source link

Backspace key not delete the character #55

Closed ciscohack closed 3 years ago

ciscohack commented 3 years ago

Hi Expert,

In moar pager if accidentally type wrong search keyword and try to delete through backspace or delete key. it's not deleting the character instead every delete key press it create ? symbol. can we fix it and how do we upgrade the moar app for future release. do i need manual download and replace all time. can we add syntax highlighting support in moar app in future

walles commented 3 years ago

Hello @ciscohack, thanks for using moar and reporting issues!

In moar pager if accidentally type wrong search keyword and try to delete through backspace or delete key. it's not deleting the character instead every delete key press it create ? symbol. can we fix it

To figure out why it doesn't work for you I'll need some information about your system and how you're using moar:

  1. What version of moar are you running? Please do moar --version and post the output here.
  2. What platform are you on? Linux, macOS, something else? If Linux, which distro / release?
  3. What are your terminal settings? Try echo $TERM and post the output here.
  4. How are you calling moar? Please tell me the exact command you use to start viewing your not-syntax-highlighted file.

Note that this works for me on my machine, so I will need more info from you to be able to say something here.

how do we upgrade the moar app for future release. do i need manual download and replace all time

For now I'm not aware of moar being packaged for any platform, but once I know what platform you're on I might be able to give you a better answer here, see questions above.

can we add syntax highlighting support in moar app in future

Syntax highlighting is built-in since version 1.2.

Let's get back to this after I know what version you're on (question 1 above).

ciscohack commented 3 years ago

Hi @walles

Thanks for quick response. I am running moar on macOS Big Sur 11.3.1 version. I saw in GitHub page you mentioned that it support chroma based syntax highlighter but due to some reason it's not working for me with BAT tool. Here are the requested data .

[praveri@ ~]$ moar --version v1.5.0 [praveri@ ~]$ echo $TERM iterm-256color

OS: macOS 11.3.1 20E241 x86_64 Host: MacBookPro16,1 Kernel: 20.4.0 Terminal App: Iterm2

Here color highlighted with less pager image

Here color not highlighted with moar pager

image

ciscohack commented 3 years ago

See in this screenshot i am trying to delete and instead of delete it's add ? mark

image

walles commented 3 years ago

What is the exact command line you're using to invoke moar?

walles commented 3 years ago

Actually, I think the missing highlighting is because moar isn't getting any color codes.

If bat sends color codes to less but not to moar, that would totally explain the coloring part of your questions.

walles commented 3 years ago

Chroma only comes into play if you do moar flupp.c for example, then you'll get your C file in glorious color.

ciscohack commented 3 years ago

i used moar and less command to invoke in above screenshot. yes i do use BAT in general. I would appreciate if you make moar compatible with BAT also in future update. But in this case i used moar command only.

Delete key issue i corrected with keybinding.

ciscohack commented 3 years ago

Chroma only comes into play if you do moar flupp.c for example, then you'll get your C file in glorious color.

image

I understand your point but can we do color for logs and txt files also like above i invoke less pager and still see colors for someof keyward i added in my iterm2 for trigger

ciscohack commented 3 years ago

I forgot to thanks you for such a amazing pager. I really loved it and i can see lot of great potential in it. Thanks once again for this great work!

walles commented 3 years ago

So what you're saying is:

Is this correct?

Can you try cat 20210303-200140926_PID-show_tech_support.txt as well? Do you get color from that?

ciscohack commented 3 years ago

So what you're saying is:

  • less 20210303-200140926_PID-show_tech_support.txt -> Color
  • moar 20210303-200140926_PID-show_tech_support.txt -> No color

Is this correct?

Can you try cat 20210303-200140926_PID-show_tech_support.txt as well? Do you get color from that?

Yes, that is what i did in above screenshot you can see. Basically in iterm2 there is a feature to trigger color highlight for keywards i defined and it's working well with less but completely un color in moar. i used pager and log reading a lot and color highlight helps me to read the file faster.

I also opened case with BAT tool Dev to see if he can make it app compatible with your pager.

walles commented 3 years ago

So cat gets you color?

Is this what you're using for highlighting? https://iterm2.com/documentation-triggers.html

ciscohack commented 3 years ago

So cat gets you color?

Is this what you're using for highlighting? https://iterm2.com/documentation-triggers.html

Yes this is the method i am using and yes cat also give me color. but now i bind cat with BAT tool. but in all condition i get the colors except moar pager

walles commented 3 years ago

moar is using alternate screen mode, that could be the cause, but I'd need to experiment to verify.

I think that less does not use alternate screen mode.

ciscohack commented 3 years ago

moar is using alternate screen mode, that could be the cause, but I'd need to experiment to verify.

I think that less does not use alternate screen mode.

Leta try and make this tool even better and compatible with more tools

ciscohack commented 3 years ago

@walles Hello my friend, i just wanted to understand in moar pager text selection not work? if yes why can we add in future this option also. Now i opened one txt based file with moar and try to grab small chunk of text but selection is not working just noticed

walles commented 3 years ago

Mouse selection is #53.

Given a number of things you've brought up above my suggestion is this:

That should cover your (and likely many other people's) needs, but still allow mouse scrolling to work out of the box (which isn't necessarily the case with less).

ciscohack commented 3 years ago

Mouse selection is #53.

Given a number of things you've brought up above my suggestion is this:

  • moar should accept a -compat command line switch which makes screen handling work as much as possible like less
  • moar should read defaults from the MOAR environment variable

That should cover your (and likely many other people's) needs, but still allow mouse scrolling to work out of the box (which isn't necessarily the case with less).

First again thanks for the prompt answer and help . i tried moar -compat <filename. indeed this solve selection problem but then with this option. I lost moar other powerful features like search-while type and highlight the searched keyword

walles commented 3 years ago

i tried moar -compat <filename

-compat doesn't exist.

If it was implemented I think it would be a good way to solve both mouse select and your highlighting issue.

ciscohack commented 3 years ago

i tried moar -compat <filename

-compat doesn't exist.

If it was implemented I think it would be a good way to solve both mouse select and your highlighting issue.

Seems i am not getting now. i able to invoke mouse though -compat switch but this breaking other functionality. Anyway we should work on our documentation also in future. to know more in depth of your amazing tool. Though i am missing some of my daily used feature but still now i am using moar as my daily driver. I have big hope you will bring many stuff in future or compatibility with other great tool like BAT as pager option

walles commented 3 years ago

Regarding iTerm's highlighting, I just tried it with iTerm 3.4.6, and it works in moar when I try it.

Screenshot is from moar 1.6.0. What iTerm version and settings did you use when iTerm's highlighting did not work for you?

moar-with-highlight iterm-triggers
ciscohack commented 3 years ago

Regarding iTerm's highlighting, I just tried it with iTerm 3.4.6, and it works in moar when I try it.

Screenshot is from moar 1.6.0. What iTerm version and settings did you use when iTerm's highlighting did not work for you?

moar-with-highlight iterm-triggers

Thanks @walles for keep trying for improvement. I am sharing with you my iterm2 profile setting with color highlight trigger. try with this. it will not work

walles commented 3 years ago

Can you just make a screenshot of your triggers config pane like I did?

walles commented 3 years ago

And post your iTerm version?

ciscohack commented 3 years ago

And post your iTerm version?

Here is my iterm2 version screenshot. See here point is your pager is working fine with syntax highlight for programming language and i tested. But as i mentioned i use iterm2 tigger to highlight syslog and any other log files and thats the point moar failed to do the job.

image

ciscohack commented 3 years ago

Yo please load my shared profile. you will get more clarity and do not open any programming file. just open any log file

walles commented 3 years ago

So I loaded your profile, ran cat, and typed Encryption hardware device as in your example.

But it's not highlighted by iTerm. From your description I thought this should be highlighted by iTerm.

What exact text could I type in my terminal to get it highlighted using your settings?

Is it iTerm, LESSFILTER, bat or something else entirely (what?) that provides you with colors in your example?

Without knowing this it is impossible for me to know why it doesn't work in moar.

not-highlighted
ciscohack commented 3 years ago

So I loaded your profile, ran cat, and typed Encryption hardware device as in your example.

But it's not highlighted by iTerm. From your description I thought this should be highlighted by iTerm.

What exact text could I type in my terminal to get it highlighted using your settings?

Is it iTerm, LESSFILTER, bat or something else entirely (what?) that provides you with colors in your example?

Without knowing this it is impossible for me to know why it doesn't work in moar.

not-highlighted

copy this log in any text file and save then open in terminal .. it will show color

WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface. WARNING: Failover is enabled but standby IP address is not configured for this interface.

walles commented 3 years ago

Works fine both with moar and cat.

Can you repro these screenshots?

If you do, can you screenshot the full windows, including borders? Higher up in this thread you only posted the middle of the windows so it's impossible to see what program it is that is showing.

cat-with-highlight moar-with-highlight
ciscohack commented 3 years ago

Works fine both with moar and cat.

Can you repro these screenshots?

If you do, can you screenshot the full windows, including borders? Higher up in this thread you only posted the middle of the windows so it's impossible to see what program it is that is showing.

cat-with-highlight moar-with-highlight

It's small text so moar not throwing error. if file size grow a bit then it will throw error basically it's get disabled but iterm2 nightly build what i have. I opened a case with them also. Try this log file

walles commented 3 years ago

Also works in moar.

Can you please post a screenshot of what it looks like when you try this file in moar?

18-36-with-colors
ciscohack commented 3 years ago

Also works in moar.

Can you please post a screenshot of what it looks like when you try this file in moar?

18-36-with-colors

Just installed the iterm2 version you have which is global public build. I am on iterm2 nightly build which has some feature not yet added in public build. So with public build i am also not facing issue. there is a feature in nightly built which detect interactive app like moar/broot tool and if it see the tool and terminal slowness . it disabled the trigger. So seems issue not with moar Thanks.

walles commented 3 years ago

Lots of sub issues here, let me try to sum this up:

I'll close this issue now in favor of #53 and #63, please continue discussions about those topics in there.

In case I missed something in the above list, please open new tickets, with one issue in each if possible!

ciscohack commented 3 years ago

Lots of sub issues here, let me try to sum this up:

I'll close this issue now in favor of #53 and #63, please continue discussions about those topics in there.

In case I missed something in the above list, please open new tickets, with one issue in each if possible!

Thanks for all your support on this ..looking forward for new features and enhancement

walles commented 3 years ago

Just out of curiosity, where did you find moar in the first place? How did you hear about it?

ciscohack commented 3 years ago

Just out of curiosity, where did you find moar in the first place? How did you hear about it?

I use BAT tool and part of that community. So i put a feature request there and one person told me the feature i am looking is in moar tool and immediately i installed. You should maintain it better way. your tool is very early stage and no man page . But i am sure you will soon come up with many cool stuff