-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command to get terminal size #13
Comments
It looks like the |
The Scala Native people might be open to a PR, but it's probably easiest to start with the CSI code and see how widely supported that is. |
At the OSS Hack Night we discovered:
As a step forward we can define a |
|
Add command (effect, program, documentation) to get the current terminal size.
It looks like the size can be obtained with the command
CSI18t
, but it's not clear this is widely supported. If it's not widely supported, the next step is to use theioctl
C API.See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html and search for
XTWINOPS
for the escape code to get the terminal size (we're interested in getting it in characters; pixels doesn't seem as useful).For example of C code using
ioctl
see https://rosettacode.org/wiki/Terminal_control/Dimensions#Library:_BSD_libcCrossterm code, which is a bit more complicated, is at https://github.com/crossterm-rs/crossterm/blob/e104a7cb400910609cdde36f322e3905c4baa805/src/terminal/sys/unix.rs#L59
The text was updated successfully, but these errors were encountered: