From owner-freebsd-stable@freebsd.org Wed Jan 25 17:59:29 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB95CC12B7 for ; Wed, 25 Jan 2017 17:59:29 +0000 (UTC) (envelope-from allbery.b@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C085192D for ; Wed, 25 Jan 2017 17:59:29 +0000 (UTC) (envelope-from allbery.b@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id c7so113746171itd.1 for ; Wed, 25 Jan 2017 09:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BghmCxzwWWla6TiZ4D27xGlKPP+UqtvbwiU8Fk7hTxc=; b=EXBP+cCNCBcRECVQbIQTF552J15xT/bwwwPc5xOVF8e/S7VKgf1SrrcpDeeHBNVVIb SKQfv1WIsXlO2T7j0AICwUnV/Y7pYgMttiQY21HuVvrvSaZN8ugggyj4majXmGjHDaiK rUPvoAvgqILyQ9FiAyEk+PpKUWOJRhFMByy+yNA4He0Eeuba0iQoWlYVgVXA0kSzR5NK BieBICW4IQS9UNmIaJ/a/wjPe4PzVTr9E8QhfYeCT34fXdZZJaThEKjuI+1UxW5G/bvg IkCQkMgz+gYcqpElP5QW8Y1F3iYpa4xAs64bzLK+mpvltWNmE9qrDSY43qD/3wPcKQvK eeIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BghmCxzwWWla6TiZ4D27xGlKPP+UqtvbwiU8Fk7hTxc=; b=lVx0sYSOjsTQrOmCyGPAfYqfdb/RF7ti+6IyD6MBddKYN8hGFDE+H9kszmtK8H+ioG 8z5bSCmIf8uWuvGqYtKuk38Wwbzr6ooUdrwiNaBnyJUUr7szU34gQmPK9LDKNsiDU1y/ M6zZWaehfBHA/fYI21YnEcXvBcQFlZ8i48ztZAI5dj6unn60TxR7N1Cpjfz/YQQk+IdD 7T3Z326UhPMvGrHcYmWr92QSujOtCzJx1D8WwlC//3eAdU8bYCtpxLexX4AZTuDZh35G 0d+5qoW+JGJt75f2IXafmqM6WMmQuceNY2AFmJYn7YsrSoMM50+/E8c9UJhnxV+hIak1 FRlg== X-Gm-Message-State: AIkVDXLsUuh3IDR9ePa13qFYomRO1vQkFocQfN6c7rYUxUT3rx5uv0XJtyemlwz69G+5wSbXplTtQLtvpXQUKg== X-Received: by 10.36.102.195 with SMTP id k186mr26862276itc.75.1485367168414; Wed, 25 Jan 2017 09:59:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.18.197 with HTTP; Wed, 25 Jan 2017 09:59:27 -0800 (PST) In-Reply-To: <5888754F.2040901@norma.perm.ru> References: <5888754F.2040901@norma.perm.ru> From: Brandon Allbery Date: Wed, 25 Jan 2017 12:59:27 -0500 Message-ID: Subject: Re: reset not working like 70% of the time To: "Eugene M. Zheganin" Cc: freebsd-stable Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2017 17:59:29 -0000 On Wed, Jan 25, 2017 at 4:52 AM, Eugene M. Zheganin 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