ztcl::vt resize
Changes the size of a terminal.
ztcl::vt resize HANDLE COLS ROWS
Description
Changes the size to COLS columns and ROWS rows, each 1 to 4,096. The text of the primary screen reflows to the new width, and the rows above the cursor go to the scrollback when the screen gets shorter. Each row is then dirty.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| HANDLE | handle | required | A handle from new. |
| COLS | integer | required | The new count of columns. |
| ROWS | integer | required | The new count of rows. |
Returns
An empty string.
Examples
Each example of this page runs after package require ztcl::vt; set vt [ztcl::vt new].
% set t [ztcl::vt new -size {10 2}]
> ztcl::vt feed $t "one\r\ntwo\r\nthree"
> ztcl::vt resize $t 5 2
> set r [list [ztcl::vt size $t] [ztcl::vt rows $t] [ztcl::vt scrollback $t]]
> ztcl::vt delete $t
> set r
{5 2} {three {}} 2
Errors
% ztcl::vt resize $vt 0 2
the size 0 is outside 1 to 4096
-errorcode ZTCL VT SIZE
% ztcl::vt resize $vt a 2
expected integer but got "a"
-errorcode TCL VALUE NUMBER
% ztcl::vt resize $vt 10
wrong # args: should be "ztcl::vt resize handle cols rows"
-errorcode TCL WRONGARGS
% ztcl::vt resize vt99 10
wrong # args: should be "ztcl::vt resize handle cols rows"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1