Skip to content
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

Backspace key not delete the character #55

Closed
ciscohack opened this issue May 9, 2021 · 36 comments
Closed

Backspace key not delete the character #55

ciscohack opened this issue May 9, 2021 · 36 comments

Comments

@ciscohack
Copy link

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
Copy link
Owner

walles commented May 9, 2021

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
Copy link
Author

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
Copy link
Author

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

image

@walles
Copy link
Owner

walles commented May 9, 2021

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

@walles
Copy link
Owner

walles commented May 9, 2021

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
Copy link
Owner

walles commented May 9, 2021

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

@ciscohack
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

walles commented May 9, 2021

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?

@ciscohack
Copy link
Author

ciscohack commented May 9, 2021

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
Copy link
Owner

walles commented May 9, 2021

So cat gets you color?

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

@ciscohack
Copy link
Author

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
Copy link
Owner

walles commented May 9, 2021

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
Copy link
Author

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
Copy link
Author

@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
Copy link
Owner

walles commented May 10, 2021

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).

@ciscohack
Copy link
Author

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
Copy link
Owner

walles commented May 10, 2021

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
Copy link
Author

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 added a commit that referenced this issue May 13, 2021
If you run moar with -trace you'll get all handled events listed after
moar finishes running.

The point would be to be able to debug mishandled keys as reported
in #55.

Also, remove the screen refresh timings from the trace logs. We get lots
of them, and I don't think they provide value any more.
walles added a commit that referenced this issue May 13, 2021
Related to #53 and #55.

With this implementation we don't restore the screen on exit, but less
does. Figure out why and make -compat work even more like less.
@walles
Copy link
Owner

walles commented May 14, 2021

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
Copy link
Author

ciscohack commented May 14, 2021

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
Copy link
Owner

walles commented May 14, 2021

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

@walles
Copy link
Owner

walles commented May 14, 2021

And post your iTerm version?

@ciscohack
Copy link
Author

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
Copy link
Author

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

@walles
Copy link
Owner

walles commented May 14, 2021

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
Copy link
Author

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
Copy link
Owner

walles commented May 14, 2021

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
Copy link
Author

ciscohack commented May 14, 2021

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
Copy link
Owner

walles commented May 14, 2021

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
Copy link
Author

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
Copy link
Owner

walles commented May 14, 2021

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!

@walles walles closed this as completed May 14, 2021
@ciscohack
Copy link
Author

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
Copy link
Owner

walles commented May 14, 2021

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

@ciscohack
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants