ssh2_shell_resize
Change the dimensions of a channel's pseudo-terminal
説明
bool ssh2_shell_resize(
resource $channel,
int $width,
int $height,
int $width_px = 0,
int $height_px = 0
)
Requests that the pseudo-terminal (PTY) attached to the given
channel be resized to the given dimensions.
注意:
The extension declares only the first three parameters, under the name
session for channel. As a
result, width_px and
height_px can only be passed positionally.
パラメータ
-
channel
-
An SSH channel stream, as returned by ssh2_exec or
ssh2_shell.
-
width
-
The width of the terminal, in characters.
-
height
-
The height of the terminal, in characters.
-
width_px
-
The width of the terminal in pixels, or
0 to leave
the pixel dimensions unspecified.
-
height_px
-
The height of the terminal in pixels, or
0 to leave
the pixel dimensions unspecified.
戻り値
Returns true, or false when channel is not an
SSH channel stream.
The outcome of the resize request itself is not reported: true is
returned even when the remote end does not honour it.
エラー / 例外
An E_WARNING is emitted when
channel is not an SSH channel stream.
例
例1 Resizing the pseudo-terminal of a shell
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$shell = ssh2_shell($connection, 'xterm', null, 80, 24);
// Tell the remote end the terminal is now 132 columns by 43 rows
ssh2_shell_resize($shell, 132, 43);
?>