Project

General

Profile

Actions

Feature #14680

open

tem: add support for window manipulation functions

Added by Toomas Soome 19 days ago. Updated 19 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

namely, add support for functions 8 and 18.

https://ttssh2.osdn.jp/manual/4/en/about/ctrlseq.html

The window manipulation sequence is CSI Ps1 ; Ps2 ; Ps3 t. We are really interested about function 18, report terminal size in characters, but since it does use function 8 for report format, we should process 8 as well (and ignore it).

The response is sent to read queue on terminal (managed by conskbd module). Normal data stream in conskbd is using message type M_DATA, and is consisting of keyboard data. Our response, however, is ascii string and does not need translating, so we use message type M_CTL (currently unused in conskbd), and pass data directly to upstream, skipping kbtrans module.

Testing done: using this script:

#!/bin/bash
stty -echo
echo -en "\e[18t" # returns \e[8;??;??t
IFS='[;'
# shellcheck disable=SC2162
# shellcheck disable=SC2034
read -d t -s esc params
# shellcheck disable=SC2086
set -- $params
[[ $# = 3 && "$1" = 8 ]] && shift
[[ $# != 2 ]] && echo error >&2 && exit 1
echo setting terminal to "$2x$1" >&2
stty echo rows "$1" cols "$2" 

Running it, does report setting terminal dimensions correctly.

Actions #1

Updated by Electric Monk 19 days ago

  • Gerrit CR set to 2141
Actions

Also available in: Atom PDF