Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2017 12:59:27 -0500
From:      Brandon Allbery <allbery.b@gmail.com>
To:        "Eugene M. Zheganin" <emz@norma.perm.ru>
Cc:        freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: reset not working like 70% of the time
Message-ID:  <CAKFCL4VOqfSzUtPSsKKt9wsmLpkOYCAhAVfbwdTh0Lgrtkh0Tg@mail.gmail.com>
In-Reply-To: <5888754F.2040901@norma.perm.ru>
References:  <5888754F.2040901@norma.perm.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 25, 2017 at 4:52 AM, Eugene M. Zheganin <emz@norma.perm.ru>
wrote:

> does anyone suffer from this too ? Right now (and for several last
> years) a 100% decent way to reset a terminal session (for instance,
> after a connection reset, after acidentally displaying a binary file
> with symbols that are treated as terminal control sequence, after
> breaking a cu session, etc) is to launch midnight commander and then
> quit from it. And the reset is working like in 30% of cases only. Unlike
> in Linux, where it's 100% functional.
>

Using an application like that to reset the terminal is dubious at best.
You are at the mercy of how exactly it does terminal conditioning, and
nobody makes any promises about its actual behavior. In fact it could be
argued that, if it does not put the terminal back exactly the way it found
it, the application is broken. But this is actually impossible to do
correctly as the application can't know the terminal's full ANSI X3.64
state. Additionally there's a bit of a "religious issue" around whether
full screen applications use xterm's alternate screen (and whether xterm
even has that enabled) which will save and restore more of the X3.64 state
around the application.

"tput reset; stty sane" (or just "reset") should usually put the terminal
into a sensible state. If it doesn't, figure out whether the part that
isn't happening is a termios or a terminfo setting and focus on that part.
Check if xterm has "Enable alternate screen switching" checked on the
control-middle button menu.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKFCL4VOqfSzUtPSsKKt9wsmLpkOYCAhAVfbwdTh0Lgrtkh0Tg>