From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: RE: nslookup (function) problem
Date: Fri, 5 May 2000 10:55:30 +0200 (MET DST) [thread overview]
Message-ID: <200005050855.KAA26248@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Fri, 5 May 2000 10:47:43 +0200 (MET DST)
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@informatik.hu-berlin.de
next reply other threads:[~2000-05-05 8:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-05 8:55 Sven Wischnowsky [this message]
2000-05-05 10:01 ` Andrej Borsenkow
-- strict thread matches above, loose matches on Subject: below --
2000-05-05 8:47 Sven Wischnowsky
2000-05-05 8:55 ` Peter Stephenson
2000-05-05 14:53 ` Bart Schaefer
2000-05-04 14:49 Sven Wischnowsky
2000-05-05 8:23 ` Andrej Borsenkow
2000-05-04 13:33 PATCH: Re: zpty and controlling tty (and other fd's) Sven Wischnowsky
2000-05-04 13:48 ` nslookup (function) problem Andrej Borsenkow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200005050855.KAA26248@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).