update sigpipe error fix in the doc
This commit is contained in:
parent
9d451ffd19
commit
3e403bb888
10
doc.go
10
doc.go
@ -1163,7 +1163,7 @@ Extensions can then be used to match cleanly within a conditional:
|
|||||||
*.rar) unrar l "$1";;
|
*.rar) unrar l "$1";;
|
||||||
*.7z) 7z l "$1";;
|
*.7z) 7z l "$1";;
|
||||||
*.pdf) pdftotext "$1" -;;
|
*.pdf) pdftotext "$1" -;;
|
||||||
*) highlight -O ansi "$1" || cat "$1";;
|
*) highlight -O ansi "$1";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
Another important consideration for efficiency is the use of programs with short startup times for preview.
|
Another important consideration for efficiency is the use of programs with short startup times for preview.
|
||||||
@ -1173,13 +1173,9 @@ This is especially relevant for big files.
|
|||||||
lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read.
|
lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read.
|
||||||
When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview.
|
When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview.
|
||||||
Note that some programs may not respond well to SIGPIPE to exit with a non-zero return code and avoid caching.
|
Note that some programs may not respond well to SIGPIPE to exit with a non-zero return code and avoid caching.
|
||||||
You may trap SIGPIPE in your preview script to avoid error propogation:
|
You may add a trailing '|| true' command to avoid such errors:
|
||||||
|
|
||||||
#!/bin/sh
|
highlight -O ansi "$1" || true
|
||||||
|
|
||||||
trap "" PIPE
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
You may also use an existing preview filter as you like.
|
You may also use an existing preview filter as you like.
|
||||||
Your system may already come with a preview filter named 'lesspipe'.
|
Your system may already come with a preview filter named 'lesspipe'.
|
||||||
|
12
docstring.go
12
docstring.go
@ -1298,7 +1298,7 @@ match cleanly within a conditional:
|
|||||||
*.rar) unrar l "$1";;
|
*.rar) unrar l "$1";;
|
||||||
*.7z) 7z l "$1";;
|
*.7z) 7z l "$1";;
|
||||||
*.pdf) pdftotext "$1" -;;
|
*.pdf) pdftotext "$1" -;;
|
||||||
*) highlight -O ansi "$1" || cat "$1";;
|
*) highlight -O ansi "$1";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
Another important consideration for efficiency is the use of programs with
|
Another important consideration for efficiency is the use of programs with
|
||||||
@ -1311,14 +1311,10 @@ script output pipe with a SIGPIPE when enough lines are read. When
|
|||||||
everything else fails, you can make use of the height argument to only feed
|
everything else fails, you can make use of the height argument to only feed
|
||||||
the first portion of the file to a program for preview. Note that some
|
the first portion of the file to a program for preview. Note that some
|
||||||
programs may not respond well to SIGPIPE to exit with a non-zero return code
|
programs may not respond well to SIGPIPE to exit with a non-zero return code
|
||||||
and avoid caching. You may trap SIGPIPE in your preview script to avoid
|
and avoid caching. You may add a trailing '|| true' command to avoid such
|
||||||
error propogation:
|
errors:
|
||||||
|
|
||||||
#!/bin/sh
|
highlight -O ansi "$1" || true
|
||||||
|
|
||||||
trap "" PIPE
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
You may also use an existing preview filter as you like. Your system may
|
You may also use an existing preview filter as you like. Your system may
|
||||||
already come with a preview filter named 'lesspipe'. These filters may have
|
already come with a preview filter named 'lesspipe'. These filters may have
|
||||||
|
14
lf.1
14
lf.1
@ -1292,22 +1292,14 @@ Since this script is called for each file selection change it needs to be as eff
|
|||||||
*.rar) unrar l "$1";;
|
*.rar) unrar l "$1";;
|
||||||
*.7z) 7z l "$1";;
|
*.7z) 7z l "$1";;
|
||||||
*.pdf) pdftotext "$1" -;;
|
*.pdf) pdftotext "$1" -;;
|
||||||
*) highlight -O ansi "$1" || cat "$1";;
|
*) highlight -O ansi "$1";;
|
||||||
esac
|
esac
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
Another important consideration for efficiency is the use of programs with short startup times for preview. For this reason, 'highlight' is recommended over 'pygmentize' for syntax highlighting. Besides, it is also important that the application is processing the file on the fly rather than first reading it to the memory and then do the processing afterwards. This is especially relevant for big files. lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read. When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview. Note that some programs may not respond well to SIGPIPE to exit with a non-zero return code and avoid caching. You may trap SIGPIPE in your preview script to avoid error propogation:
|
Another important consideration for efficiency is the use of programs with short startup times for preview. For this reason, 'highlight' is recommended over 'pygmentize' for syntax highlighting. Besides, it is also important that the application is processing the file on the fly rather than first reading it to the memory and then do the processing afterwards. This is especially relevant for big files. lf automatically closes the previewer script output pipe with a SIGPIPE when enough lines are read. When everything else fails, you can make use of the height argument to only feed the first portion of the file to a program for preview. Note that some programs may not respond well to SIGPIPE to exit with a non-zero return code and avoid caching. You may add a trailing '|| true' command to avoid such errors:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
#!/bin/sh
|
highlight -O ansi "$1" || true
|
||||||
.EE
|
|
||||||
.PP
|
|
||||||
.EX
|
|
||||||
trap "" PIPE
|
|
||||||
.EE
|
|
||||||
.PP
|
|
||||||
.EX
|
|
||||||
...
|
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
You may also use an existing preview filter as you like. Your system may already come with a preview filter named 'lesspipe'. These filters may have a mechanism to add user customizations as well. See the related documentations for more information.
|
You may also use an existing preview filter as you like. Your system may already come with a preview filter named 'lesspipe'. These filters may have a mechanism to add user customizations as well. See the related documentations for more information.
|
||||||
|
Loading…
Reference in New Issue
Block a user