~ubuntu-branches/ubuntu/lucid/zsh-beta/lucid

« back to all changes in this revision

Viewing changes to Doc/zshmodules.1

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Porcheron
  • Date: 2007-11-07 21:17:29 UTC
  • mfrom: (1.1.33 upstream)
  • Revision ID: james.westby@ubuntu.com-20071107211729-t20yh1yfbv7vvdxf
Tags: 4.3.4-dev-1+20071030-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  -  Add "add-shell /bin/zsh" because zsh-beta is already registered
     as an alternative to zsh, and this is needed to be able to have
     zsh-beta as the only installed zsh.
  - Don't set PATH in zshenv any more
  - Update maintainer in field debian/control.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
A module with utility builtins needed for the shell function based
34
34
completion system\&.
35
35
.TP
 
36
\fBzsh/curses\fP
 
37
curses windowing commands
 
38
.TP
36
39
\fBzsh/datetime\fP
37
40
Some date/time commands and parameters\&.
38
41
.TP
659
662
.TP
660
663
\fBcompvalues\fP
661
664
Like \fBcomparguments\fP, but for the \fB_values\fP function\&.
 
665
.SH "THE ZSH/CURSES MODULE"
 
666
.\" Yodl file: Zsh/mod_curses.yo
 
667
 
 
668
The \fBzsh/curses\fP module makes available one builtin command and
 
669
various parameters\&.
 
670
.PP
 
671
.SS "Builtin"
 
672
.PP
 
673
.PD 0
 
674
.TP
 
675
.PD 0
 
676
\fBzcurses\fP \fBinit\fP
 
677
.TP
 
678
.PD 0
 
679
\fBzcurses\fP \fBend\fP
 
680
.TP
 
681
.PD 0
 
682
\fBzcurses\fP \fBaddwin\fP \fItargetwin\fP \fInlines\fP \fIncols\fP \fIbegin_y\fP \fIbegin_x\fP [ \fIparentwin\fP ] 
 
683
.TP
 
684
.PD 0
 
685
\fBzcurses\fP \fBdelwin\fP \fItargetwin\fP 
 
686
.TP
 
687
.PD 0
 
688
\fBzcurses\fP \fBrefresh\fP [ \fItargetwin\fP \&.\&.\&. ] 
 
689
.TP
 
690
.PD 0
 
691
\fBzcurses\fP \fBtouch\fP \fItargetwin\fP \&.\&.\&.
 
692
.TP
 
693
.PD 0
 
694
\fBzcurses\fP \fBmove\fP \fItargetwin\fP \fInew_y\fP \fInew_x\fP 
 
695
.TP
 
696
.PD 0
 
697
\fBzcurses\fP \fBclear\fP \fItargetwin\fP [ \fBredraw\fP | \fBeol\fP | \fBbot\fP ]
 
698
.TP
 
699
.PD 0
 
700
\fBzcurses\fP \fBlocation\fP \fItargetwin\fP \fIarray\fP
 
701
.TP
 
702
.PD 0
 
703
\fBzcurses\fP \fBchar\fP \fItargetwin\fP \fIcharacter\fP 
 
704
.TP
 
705
.PD 0
 
706
\fBzcurses\fP \fBstring\fP \fItargetwin\fP \fIstring\fP 
 
707
.TP
 
708
.PD 0
 
709
\fBzcurses\fP \fBborder\fP \fItargetwin\fP \fIborder\fP (
 
710
.TP
 
711
.PD 0
 
712
\fBzcurses\fP \fBattr\fP \fItargetwin\fP [ \fI{+/\-}attribute\fP | \fIfg_col\fP\fB/\fP\fIbg_col\fP ] [\&.\&.\&.]
 
713
.TP
 
714
.PD 0
 
715
\fBzcurses\fP \fBscroll\fP [ \fBon\fP | \fBoff\fP | {+/\-}\fIlines\fP ]
 
716
.TP
 
717
.PD 0
 
718
\fBzcurses\fP \fBinput\fP \fItargetwin\fP [ \fIparam\fP [ \fIkpparm\fP ] ]
 
719
.TP
 
720
.PD
 
721
\fBzcurses\fP \fBtimeout\fP \fItargetwin\fP \fIintval\fP
 
722
Manipulate curses windows\&.  All uses of this command should be
 
723
bracketed by `\fBzcurses init\fP\&' to initialise use of curses, and
 
724
`\fBzcurses end\fP\&' to end it; omitting `\fBzcurses end\fP' can cause
 
725
the terminal to be in an unwanted state\&.
 
726
.RS
 
727
.PP
 
728
With \fBaddwin\fP, create a window with \fInlines\fP lines and \fIncols\fP columns\&.
 
729
Its upper left corner will be placed at row \fIbegin_y\fP and column
 
730
\fIbegin_x\fP of the screen\&.  \fItargetwin\fP is a string and refers
 
731
to the name of a window that is not currently assigned\&.  Note
 
732
in particular the curses convention that vertical values appear
 
733
before horizontal values\&.
 
734
.PP
 
735
If \fBaddwin\fP is given an existing window as the final argument, the new
 
736
window is created as a subwindow of \fIparentwin\fP\&.  This differs from an
 
737
ordinary new window in that the memory of the window contents is shared
 
738
with the parent\&'s memory\&.  Subwindows must be deleted before their parent\&.
 
739
Note that the coordinates of subwindows are relative to the screen, not
 
740
the parent, as with other windows
 
741
.PP
 
742
Use \fBdelwin\fP to delete a window created with \fBaddwin\fP\&.  Note
 
743
that \fBend\fP does \fInot\fP implicitly delete windows, and that
 
744
\fBdelwin\fP does not erase the screen image of the window\&.
 
745
.PP
 
746
The window corresponding to the full visible screen is called
 
747
\fBstdscr\fP; it always exists after `\fBzcurses init\fP\&' and cannot
 
748
be delete with \fBdelwin\fP\&.
 
749
.PP
 
750
The \fBrefresh\fP command will refresh window \fItargetwin\fP; this is
 
751
necessary to make any pending changes (such as characters you have
 
752
prepared for output with \fBchar\fP) visible on the screen\&.  \fBrefresh\fP
 
753
without an argument causes the screen to be cleared and redrawn\&.
 
754
If multiple windows are given, the screen is updated once at the end\&.
 
755
.PP
 
756
The \fBtouch\fP command marks the \fItargetwin\fPs listed as changed\&.
 
757
This is necessary before \fBrefresh\fPing windows if a window that
 
758
was in front of another window (which may be \fBstdscr\fP) is deleted\&.
 
759
.PP
 
760
\fBmove\fP moves the cursor position in \fItargetwin\fP to new coordinates
 
761
\fInew_y\fP and \fInew_x\fP\&.
 
762
.PP
 
763
\fBclear\fP erases the contents of \fItargetwin\fP\&.  One (and no more than one)
 
764
of three options may be specified\&.  With the option \fBredraw\fP,
 
765
in addition the next \fBrefresh\fP of \fItargetwin\fP will cause the screen to be
 
766
cleared and repainted\&.  With the option \fBeol\fP, \fItargetwin\fP is only
 
767
cleared to the end of the current cursor line\&.  With the option
 
768
\fBbot\fP, \fItargetwin\fP is cleared to the end of the window, i\&.e
 
769
everything to the right and below the cursor is cleared\&.
 
770
.PP
 
771
\fBlocation\fP writes various positions associated with \fItargetwin\fP
 
772
into the array named \fIarray\fP\&.
 
773
These are, in order:
 
774
.PD 0
 
775
.TP
 
776
 
 
777
The y and x coordinates of the cursor relative to the top left
 
778
of \fItargetwin\fP
 
779
.TP
 
780
 
 
781
The y and x coordinates of the top left of \fItargetwin\fP on the
 
782
screen
 
783
.TP
 
784
 
 
785
The size of \fItargetwin\fP in y and x dimensions\&.
 
786
.PD
 
787
.PP
 
788
Outputting characters and strings are achieved by \fBchar\fP and \fBstring\fP
 
789
respectively\&.
 
790
.PP
 
791
To draw a border around window \fItargetwin\fP, use \fBborder\fP\&.  Note
 
792
that the border is not subsequently handled specially:  in other words,
 
793
the border is simply a set of characters output at the edge of the
 
794
window\&.  Hence it can be overwritten, can scroll off the window, etc\&.
 
795
.PP
 
796
\fBattr\fP will set \fItargetwin\fP\&'s attributes or foreground/background
 
797
color pair for any successive character output\&.  Each \fIattribute\fP
 
798
given on the line may be prepended by a \fB+\fP to set or a \fB\-\fP to
 
799
unset that attribute; \fB+\fP is assumed if absent\&.  The attributes
 
800
supported are \fBblink\fP, \fBbold\fP, \fBdim\fP, \fBreverse\fP, \fBstandout\fP,
 
801
and \fBunderline\fP\&.
 
802
.PP
 
803
Each \fIfg_col\fP\fB/\fP\fIbg_col\fP attribute (to be read as
 
804
`\fIfg_col\fP on \fIbg_col\fP\&') sets the foreground and background color
 
805
for character output\&.  The color \fBdefault\fP is sometimes available
 
806
(in particular if the library is ncurses), specifying the foreground
 
807
or background color with which the terminal started\&.  The color pair
 
808
\fBdefault/default\fP is always available\&.
 
809
.PP
 
810
\fBscroll\fP can be used with \fBon\fP or \fBoff\fP to enabled or disable
 
811
scrolling of a window when the cursor would otherwise move below the
 
812
window due to typing or output\&.  It can also be used with a positive
 
813
or negative integer to scroll the window up or down the given number
 
814
of lines without changing the current cursor position (which therefore
 
815
appears to move in the opposite direction relative to the window)\&.
 
816
In the second case, if scrolling is \fBoff\fP it is temporarily turned \fBon\fP
 
817
to allow the window to be scrolled\&.
 
818
.PP
 
819
\fBinput\fP reads a single character from the window without echoing
 
820
it back\&.  If \fIparam\fP is supplied the character is assigned to the
 
821
parameter \fIparam\fP, else it is assigned to the parameter \fIREPLY\fP\&.
 
822
If both \fIparam\fP and \fIkpparam\fP are supplied, the key is read
 
823
in `keypad\&' mode\&.  In this mode special keys such as function keys
 
824
and arrow keys return the name of the key in the parameter \fIkpparam\fP\&.
 
825
The key names are the macros defined in the \fBcurses\&.h\fP or \fBncurses\&.h\fP
 
826
with the prefix `\fBKEY_\fP\&' removed\&.  Other keys cause a value to be set in
 
827
\fIparam\fP as before\&.  On a succesful return only one of \fIparam\fP or
 
828
\fIkpparm\fP contains a non\-empty string; the other is set to an empty
 
829
string\&.
 
830
.PP
 
831
\fBtimeout\fP specifies a timeout value for input from \fItargetwin\fP\&.
 
832
If \fIintval\fP is negative, `\fBzcurses input\fP\&' waits indefinitely for
 
833
a character to be typed; this is the default\&.  If \fIintval\fP is zero,
 
834
`\fBzcurses input\fP\&' returns immediately; if there is typeahead it is
 
835
returned, else no input is done and status 1 is returned\&.  If \fIintval\fP
 
836
is positive, `\fBzcurses input\fP\&' waits \fIintval\fP milliseconds for
 
837
input and if there is none at the end of that period returns status 1\&.
 
838
.RE
 
839
.RE
 
840
.PP
 
841
.SS "Parameters"
 
842
.PP
 
843
.PD 0
 
844
.TP
 
845
.PD
 
846
\fBZCURSES_COLORS\fP
 
847
Readonly integer\&.  The maximum number of colors the terminal
 
848
supports\&.  This value is initialised by the curses library and is not
 
849
available until the first time \fBzcurses init\fP is run\&.
 
850
.TP
 
851
\fBZCURSES_COLOR_PAIRS\fP
 
852
Readonly integer\&.  The maximum number of color pairs
 
853
\fIfg_col\fP\fB/\fP\fIbg_col\fP that may be defined in `\fBzcurses attr\fP\&'
 
854
commands; note this limit applies to all color pairs that have been
 
855
used whether or not they are currently active\&.  This value is initialised
 
856
by the curses library and is not available until the first time \fBzcurses
 
857
init\fP is run\&.
 
858
.TP
 
859
\fBzcurses_attrs\fP
 
860
Readonly array\&.  The attributes supported by \fBzsh/curses\fP; available
 
861
as soon as the module is loaded\&.
 
862
.TP
 
863
\fBzcurses_colors\fP
 
864
Readonly array\&.  The colors supported by \fBzsh/curses\fP; available
 
865
as soon as the module is loaded\&.
 
866
.TP
 
867
\fBzcurses_windows\fP
 
868
Readonly array\&.  The current list of windows, i\&.e\&. all windows that
 
869
have been created with `\fBzcurses addwin\fP\&' and not removed with
 
870
`\fBzcurses delwin\fP\&'\&.
662
871
.SH "THE ZSH/DATETIME MODULE"
663
872
.\" Yodl file: Zsh/mod_datetime.yo
664
873