-
Notifications
You must be signed in to change notification settings - Fork 10
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
man pages are not readable on macOS #27
Comments
Hmm, for the same
|
So, your Pipe Contents are different.. will need to investigate.. |
Just tested this on |
That was going to be my next question :)
Phew! :)
Thank you! |
Here is some documentation incase any other fish users want to look at this issue: https://fishshell.com/docs/current/tutorial.html#tut_pipes_and_redirections. |
So here's what I found: https://stackoverflow.com/a/37531498/7873568 The command |
Do you want to hack the My best guess is that This line -- It's where |
Of course the quick and easy way would be to check |
Something is very confusing.. You got this printed:
That indicates that the So this if [[ ${output_to_pipe_flag} -eq 1 ]]
then
echo "This script is not supposed to send output to a pipe"
exit 1 .. then why is that echo message leaking into the pipeline_data?:
Odd.. |
Did some testing:
I think fish is supposed to properly recognize the shebang |
which variable is being used as command (which command?).. We are just checking if a FOO variable is 1. |
Do you want to see if a change like this in the whole script fixes this for you? diff --git a/eless b/eless
index e973726..78bada8 100755
--- a/eless
+++ b/eless
@@ -492,7 +492,7 @@ function emacs_Q_view_mode {
# Below if condition is reached if you try to do this:
# eless foo.txt | grep bar .. Not allowed!
-if [[ ${output_to_pipe_flag} -eq 1 ]]
+if test ${output_to_pipe_flag} -eq 1
then If so, please provide a PR, and I will try it out on my side. |
Alternatively, see if
( does the same thing i.e. fixes this issue for you. |
I'll test the single square bracket one now. |
Single square bracket test was functional as well. |
However, setting |
Thanks to https://stackoverflow.com/a/35661359/1219634 and http://hyperpolyglot.org/unix-shells#arith-conditional-expr. Though.. the bigger question still remains.. why does Do you have |
Though, now the |
Nope, my How would you propose I enable debugging when just using something like |
Now that I think about it, let me set |
Yup, you got it .. also: https://eless.scripter.co/#how-to-help-debug :) |
Got a different output this time inside the
And the debug output:
|
Hmm.. compared to my debug output ( #27 (comment) ), your output now looks the same, except of course the Temp File. But you still are getting "This script is not supposed to send output to a pipe" from an if block that should not be executed.. Do you have any |
Replaced all of the |
Still wondering why that if block (containing "This script is not supposed to send output to a pipe") is getting executed.. But in any case, I can only guess..
|
Ah, OK, sorry, I misunderstood. The issue is the @mobyte0 is seeing this error instead of the man page: #27 (comment) What's perplexing is that that error is printing from the if clause that should never have been accessed for the |
Okay. I do have that problem ( From the
So I assume the reason you're getting the warning is that the pages formatted by I also get mangled characters. Like this, but only for certain man pages (For me only Perl and Tk man pages, e.g., As you can see from
|
Hi, my bash version shows below.
I also have tried 4.4, but still failed. Other than that, when I use
everything is okay, however, when I use
" |
@sshaw @mobyte0 @nasyxx So are these 2 statements correct for the
Alright, things have anyways got complicated.. so let's leave |
Hi, I added but it still does not work. When I run And
|
I fixed the "mangled characters" issue today morning.. please update to the latest master. The mangled characters are actually ascii color codes that the reader should interpret (like man mode in Emacs, or the man binary). |
And I get this on doing
That last bit:
is quite different on my system. |
And on doing with
|
This is like shooting in the dark.. Does |
Thinking more about it.. not exactly.. You get that "This script is not .." error when it correctly gets detected as a man page i.e. when this if condition gets executed. When it was not getting detected (before this fix), it was entering this final else clause. So all man page raw data including the man page color codes showed up without rendering in emacs buffer. So that part makes sense now. So based on @sshaw's experience, |
OK, so if If so, please share the alias that works for you. Of course, if one of you can provide a true fix so that |
I am not sure how to make an alias with parameters in ZSH. So I write it as:
|
@nasyxx Thanks! That almost works on bash.. I have verified this to work on bash (ref):
The fix was to add that |
It still works for me on zsh. |
Here's a totally gross alias that I've set up to solve the problem (in
So basically, it just takes the man page and pipes it right into |
I have updated the documentation in the latest commit on master. Now we have this section: https://eless.scripter.co/#example-eless-config-in-bash |
Oh, hey, I found an even better solution. Interestingly enough, I realized that in the man pages for Hopefully this helps! |
@mobyte0 Very cool! that's definitely less work than the earlier alias. So does this alias work for you:
If so, I'll update the documentation. Also, does this issue need to stay open any more? Update Or may be the below.. if you want to leave the default
|
I believe it is safe to close this issue as Ref: https://eless.scripter.co/#example-eless-config-in-bash |
(This top portion is edited by @kaushalmodi)
Workaround
Due to the way
man
handles the man page caching and streaming on macOS systems,PAGER=eless man ls
does not work there.But
PAGER=less man ls | eless
works! See #27 (comment) for details.(The original post now follows below.)
Mentioned this issue in #18.
This script is not supposed to send output to a pipe
displayed ineless
.The text was updated successfully, but these errors were encountered: