Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: nslookup (function) problem
- X-seq: zsh-workers 11180
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: RE: nslookup (function) problem
- Date: Fri, 5 May 2000 10:55:30 +0200 (MET DST)
- In-reply-to: Sven Wischnowsky's message of Fri, 5 May 2000 10:47:43 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Err, sorry, I applied a slightly different patch that pages only if
there are more lines than fit on the screen.
I wrote:
Bye
Sven
Index: Functions/Misc/nslookup
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/nslookup,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 nslookup
--- Functions/Misc/nslookup 2000/03/10 01:01:03 1.1.1.9
+++ Functions/Misc/nslookup 2000/05/05 08:45:38
@@ -4,6 +4,8 @@
setopt localoptions localtraps completealiases
local tmp line compcontext=nslookup curcontext='nslookup:::' pmpt
+local pager opager="$PAGER"
+typeset +g -x PAGER=cat
zmodload -e zsh/zpty || zmodload -i zsh/zpty
@@ -13,6 +15,8 @@
pmpt=()
zstyle -s ':nslookup' prompt tmp && pmpt=(-p "$tmp")
zstyle -s ':nslookup' rprompt tmp && pmpt=("$pmpt[@]" -r "$tmp")
+zstyle -s ':nslookup' pager tmp &&
+ [[ -z "$pager" ]] && pager="${opager:-more}"
(( $#pmpt )) || pmpt=(-p '> ')
zpty nslookup nslookup
@@ -29,7 +33,11 @@
zpty -r nslookup line '*
> '
- print -nr "$line"
+ if [[ -n "$pager" && ${#${(f)line}} -gt LINES ]]; then
+ print -nr "$line" | "$pager"
+ else
+ print -nr "$line"
+ fi
done
zpty -w nslookup 'exit'
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author