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

« back to all changes in this revision

Viewing changes to Doc/Zsh/mod_curses.yo

  • 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:
11
11
cindex(windows, curses)
12
12
xitem(tt(zcurses) tt(init))
13
13
xitem(tt(zcurses) tt(end))
14
 
xitem(tt(zcurses) tt(addwin) var(targetwin) var(nlines) var(ncols) var(begin_y) var(begin_x) )
 
14
xitem(tt(zcurses) tt(addwin) var(targetwin) var(nlines) var(ncols) var(begin_y) var(begin_x) [ var(parentwin) ] )
15
15
xitem(tt(zcurses) tt(delwin) var(targetwin) )
16
 
xitem(tt(zcurses) tt(refresh) [ var(targetwin) ] )
 
16
xitem(tt(zcurses) tt(refresh) [ var(targetwin) ... ] )
 
17
xitem(tt(zcurses) tt(touch) var(targetwin) ...)
17
18
xitem(tt(zcurses) tt(move) var(targetwin) var(new_y) var(new_x) )
 
19
xitem(tt(zcurses) tt(clear) var(targetwin) [ tt(redraw) | tt(eol) | tt(bot) ])
 
20
xitem(tt(zcurses) tt(location) var(targetwin) var(array))
18
21
xitem(tt(zcurses) tt(char) var(targetwin) var(character) )
19
22
xitem(tt(zcurses) tt(string) var(targetwin) var(string) )
20
23
xitem(tt(zcurses) tt(border) var(targetwin) var(border) )(
21
24
xitem(tt(zcurses) tt(attr) var(targetwin) [ var({+/-}attribute) | var(fg_col)tt(/)var(bg_col) ] [...])
22
 
item(tt(zcurses) tt(scroll) [ tt(on) | tt(off) | {+/-}var(lines) ])(
 
25
xitem(tt(zcurses) tt(bg) var(targetwin) [ var({+/-}attribute) | var(fg_col)tt(/)var(bg_col) | tt(@)var(char) ] [...])
 
26
xitem(tt(zcurses) tt(scroll) [ tt(on) | tt(off) | {+/-}var(lines) ])
 
27
xitem(tt(zcurses) tt(input) var(targetwin) [ var(param) [ var(kpparm) ] ])
 
28
item(tt(zcurses) tt(timeout) var(targetwin) var(intval))(
23
29
Manipulate curses windows.  All uses of this command should be
24
30
bracketed by `tt(zcurses init)' to initialise use of curses, and
25
31
`tt(zcurses end)' to end it; omitting `tt(zcurses end)' can cause
28
34
With tt(addwin), create a window with var(nlines) lines and var(ncols) columns.
29
35
Its upper left corner will be placed at row var(begin_y) and column
30
36
var(begin_x) of the screen.  var(targetwin) is a string and refers
31
 
to the name of a window that is not currently assigned.
 
37
to the name of a window that is not currently assigned.  Note
 
38
in particular the curses convention that vertical values appear
 
39
before horizontal values.
 
40
 
 
41
If tt(addwin) is given an existing window as the final argument, the new
 
42
window is created as a subwindow of var(parentwin).  This differs from an
 
43
ordinary new window in that the memory of the window contents is shared
 
44
with the parent's memory.  Subwindows must be deleted before their parent.
 
45
Note that the coordinates of subwindows are relative to the screen, not
 
46
the parent, as with other windows.
32
47
 
33
48
Use tt(delwin) to delete a window created with tt(addwin).  Note
34
 
that tt(end) does em(not) implicitly delete windows.
35
 
 
36
 
The tt(refresh) command will refresh window var(targetwin); this is necessary to
37
 
make any pending changes (such as characters you have prepared for output
38
 
with tt(char)) visible on the screen.  If no argument is given,
39
 
all windows are refreshed; this is necessary after deleting a window.
 
49
that tt(end) does em(not) implicitly delete windows, and that
 
50
tt(delwin) does not erase the screen image of the window.
 
51
 
 
52
The window corresponding to the full visible screen is called
 
53
tt(stdscr); it always exists after `tt(zcurses init)' and cannot
 
54
be delete with tt(delwin).
 
55
 
 
56
The tt(refresh) command will refresh window var(targetwin); this is
 
57
necessary to make any pending changes (such as characters you have
 
58
prepared for output with tt(char)) visible on the screen.  tt(refresh)
 
59
without an argument causes the screen to be cleared and redrawn.
 
60
If multiple windows are given, the screen is updated once at the end.
 
61
 
 
62
The tt(touch) command marks the var(targetwin)s listed as changed.
 
63
This is necessary before tt(refresh)ing windows if a window that
 
64
was in front of another window (which may be tt(stdscr)) is deleted.
40
65
 
41
66
tt(move) moves the cursor position in var(targetwin) to new coordinates
42
67
var(new_y) and var(new_x).
43
68
 
 
69
tt(clear) erases the contents of var(targetwin).  One (and no more than one)
 
70
of three options may be specified.  With the option tt(redraw),
 
71
in addition the next tt(refresh) of var(targetwin) will cause the screen to be
 
72
cleared and repainted.  With the option tt(eol), var(targetwin) is only
 
73
cleared to the end of the current cursor line.  With the option
 
74
tt(bot), var(targetwin) is cleared to the end of the window, i.e
 
75
everything to the right and below the cursor is cleared.
 
76
 
 
77
tt(location) writes various positions associated with var(targetwin)
 
78
into the array named var(array).
 
79
These are, in order:
 
80
startsitem()
 
81
sitem()(The y and x coordinates of the cursor relative to the top left
 
82
of var(targetwin))
 
83
sitem()(The y and x coordinates of the top left of var(targetwin) on the
 
84
screen)
 
85
sitem()(The size of var(targetwin) in y and x dimensions.)
 
86
endsitem()
 
87
 
44
88
Outputting characters and strings are achieved by tt(char) and tt(string)
45
89
respectively.
46
90
 
47
 
To draw a border around window var(targetwin), use tt(border).
 
91
To draw a border around window var(targetwin), use tt(border).  Note
 
92
that the border is not subsequently handled specially:  in other words,
 
93
the border is simply a set of characters output at the edge of the
 
94
window.  Hence it can be overwritten, can scroll off the window, etc.
48
95
 
49
96
tt(attr) will set var(targetwin)'s attributes or foreground/background
50
97
color pair for any successive character output.  Each var(attribute)
51
98
given on the line may be prepended by a tt(+) to set or a tt(-) to
52
99
unset that attribute; tt(+) is assumed if absent.  The attributes
53
100
supported are tt(blink), tt(bold), tt(dim), tt(reverse), tt(standout),
54
 
and tt(underline).  Each var(fg_col)tt(/)var(bg_col) (to be read as
 
101
and tt(underline).
 
102
 
 
103
Each var(fg_col)tt(/)var(bg_col) attribute (to be read as
55
104
`var(fg_col) on var(bg_col)') sets the foreground and background color
56
 
for character output.
 
105
for character output.  The color tt(default) is sometimes available
 
106
(in particular if the library is ncurses), specifying the foreground
 
107
or background color with which the terminal started.  The color pair
 
108
tt(default/default) is always available.
 
109
 
 
110
tt(bg) overrides the color and other attributes of all characters in the
 
111
window.  Its usual use is to set the background initially, but it will
 
112
overwrite the attributes of any characters at the time when it is called.
 
113
In addition to the arguments allowed with tt(attr), an argument tt(@)var(char)
 
114
specifies a character to be shown in otherwise blank areas of the window.
 
115
Owing to limitations of curses this cannot be a multibyte character
 
116
(use of ASCII characters only is recommended).  As the specified set
 
117
of attributes override the existing background, turning attributes
 
118
off in the arguments is not useful, though this does not cause an error.
57
119
 
58
120
tt(scroll) can be used with tt(on) or tt(off) to enabled or disable
59
121
scrolling of a window when the cursor would otherwise move below the
62
124
of lines without changing the current cursor position (which therefore
63
125
appears to move in the opposite direction relative to the window).
64
126
In the second case, if scrolling is tt(off) it is temporarily turned tt(on)
65
 
to allow the window to be scrolled,
 
127
to allow the window to be scrolled.
 
128
 
 
129
tt(input) reads a single character from the window without echoing
 
130
it back.  If var(param) is supplied the character is assigned to the
 
131
parameter var(param), else it is assigned to the parameter var(REPLY).
 
132
If both var(param) and var(kpparam) are supplied, the key is read
 
133
in `keypad' mode.  In this mode special keys such as function keys
 
134
and arrow keys return the name of the key in the parameter var(kpparam).
 
135
The key names are the macros defined in the tt(curses.h) or tt(ncurses.h)
 
136
with the prefix `tt(KEY_)' removed.  Other keys cause a value to be set in
 
137
var(param) as before.  On a succesful return only one of var(param) or
 
138
var(kpparm) contains a non-empty string; the other is set to an empty
 
139
string.
 
140
 
 
141
tt(timeout) specifies a timeout value for input from var(targetwin).
 
142
If var(intval) is negative, `tt(zcurses input)' waits indefinitely for
 
143
a character to be typed; this is the default.  If var(intval) is zero,
 
144
`tt(zcurses input)' returns immediately; if there is typeahead it is
 
145
returned, else no input is done and status 1 is returned.  If var(intval)
 
146
is positive, `tt(zcurses input)' waits var(intval) milliseconds for
 
147
input and if there is none at the end of that period returns status 1.
66
148
)
67
149
enditem()
68
150