summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@netgate.com>2019-05-30 10:10:52 -0400
committerjim-p <jimp@netgate.com>2019-05-30 10:12:55 -0400
commit113173b9823aa2712c643c919f70e9d6a34df69d (patch)
treebcd3662b43ee8cfe1ce6a427b2fa1bc82fc5f08e
parentde0e62a145f1130bbe846ee5e87360fdb1dba12f (diff)
downloadpfsense-113173b9823aa2712c643c919f70e9d6a34df69d.zip
pfsense-113173b9823aa2712c643c919f70e9d6a34df69d.tar.gz
Terminal size detection. Fixes #9569
For sh/.profile, run "resizewin -z" at login which will set the terminal type only when empty, which is kind to remote and local logins and has the intended behavior. Also for tcsh, if the user logs in from the serial console, use postcmd to resize the window after each command in case the user resizes the window. (cherry picked from commit 1dc4afdc6657e83e824be43b27eff8a5f35ea4f3)
-rw-r--r--src/etc/skel/dot.profile1
-rw-r--r--src/etc/skel/dot.shrc1
-rw-r--r--src/etc/skel/dot.tcshrc5
3 files changed, 7 insertions, 0 deletions
diff --git a/src/etc/skel/dot.profile b/src/etc/skel/dot.profile
index 6c5e598..890cd60 100644
--- a/src/etc/skel/dot.profile
+++ b/src/etc/skel/dot.profile
@@ -30,6 +30,7 @@ else
fi
if [ -n "${_interactive}" ]; then
+ /usr/bin/resizewin -z
/etc/rc.initial
exit
fi
diff --git a/src/etc/skel/dot.shrc b/src/etc/skel/dot.shrc
index 5766d9f..7a0c56b 100644
--- a/src/etc/skel/dot.shrc
+++ b/src/etc/skel/dot.shrc
@@ -51,6 +51,7 @@ else
fi
if [ -n "${_interactive}" ]; then
+ /usr/bin/resizewin -z
/etc/rc.initial
exit
fi
diff --git a/src/etc/skel/dot.tcshrc b/src/etc/skel/dot.tcshrc
index 6bae4e4..dcfbc0c 100644
--- a/src/etc/skel/dot.tcshrc
+++ b/src/etc/skel/dot.tcshrc
@@ -37,6 +37,11 @@ if ($term == "xterm" || $term == "vt100" || $term == "vt102" || $term == "vt220"
bindkey "\e[7~" beginning-of-line # Home rxvt/konsole
bindkey "\e[8~" end-of-line # End rxvt/konsole
+
+ set termtype=`echo ${tty} | /usr/bin/sed 's/[[:digit:]]*$//'`
+ if ("${termtype}" == "ttyu") then
+ alias postcmd '/usr/bin/resizewin'
+ endif
endif
set http_proxy=`/usr/local/sbin/read_xml_tag.sh string system/proxyurl`
OpenPOWER on IntegriCloud