Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions runtime/entrypoint.d/sttysize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

RC=${HOME}/.bashrc
SNIPPET=/st2-docker/entrypoint.d/sttysize.snippet

if ! grep -q sttysize ${RC}; then
echo >> ${RC}
echo "[ -r ${SNIPPET} ] && . ${SNIPPET}" >> ${RC}
fi
17 changes: 17 additions & 0 deletions runtime/entrypoint.d/sttysize.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ensure the entire terminal is used. This particular code comes from
# https://gist.github.com/scentoni/f4bda3a07cf7711125de3928f95809af

res() {

old=$(stty -g)
stty raw -echo min 0 time 5

printf '\033[18t' > /dev/tty
IFS=';t' read -r _ rows cols _ < /dev/tty

stty "$old"

stty cols "$cols" rows "$rows"
}

res