Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757846AbcLAVbq (ORCPT ); Thu, 1 Dec 2016 16:31:46 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:51823 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbcLAVbo (ORCPT ); Thu, 1 Dec 2016 16:31:44 -0500 X-ME-Sender: X-Sasl-enc: KkVq2RP4YAnlKYvmggF65w4izTBdkX1HyORxkc2xhLyX 1480627903 Date: Thu, 1 Dec 2016 21:31:40 +0000 From: Andrey Utkin To: Manuel =?iso-8859-1?Q?Sch=F6lling?= Cc: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, jslaby@suse.cz, gregkh@linuxfoundation.org, kilobyte@angband.pl, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 0/3] console: Add persistent scrollback buffers for all VGA consoles Message-ID: <20161201213140.GF27009@dell-m4800.home> References: <20161123173340.GA24872@angband.pl> <1480265509-20922-1-git-send-email-manuel.schoelling@gmx.de> <20161127213730.GO11418@dell-m4800.home> <1480368499.29156.12.camel@gmx.de> <20161129100115.GA20034@stationary.pb.com> <1480626203.7664.7.camel@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1480626203.7664.7.camel@gmx.de> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2203 Lines: 54 On Thu, Dec 01, 2016 at 10:03:23PM +0100, Manuel Sch?lling wrote: > Hi Andrey, > > On Di, 2016-11-29 at 10:01 +0000, Andrey Utkin wrote: > > On Mon, Nov 28, 2016 at 10:28:19PM +0100, Manuel Sch?lling wrote: > > Regarding logout scrollback clearing not working for me. ncurses-6.0-rc1 > > which I tested it with is the latest available in Gentoo portage, please > > confirm whether I need any newer version, or should I tune something > > else. I'd appreciate if you also tested your patch with gentoo setup. > > I finally setup gentoo Wow, what a big undertaking. > running agetty (util-linux-2.26.2) and patching > the file term-utils/agetty.c with > > static void termio_clear(int fd) > { > /* > * Do not write a full reset (ESC c) because this destroys > * the unicode mode again if the terminal was in unicode > * mode. Also it clears the CONSOLE_MAGIC features which > * are required for some languages/console-fonts. > * Just put the cursor to the home position (ESC [ H), > * erase everything below the cursor (ESC [ J), and set the > * scrolling region to the full window (ESC [ r) > */ > - write_all(fd, "\033[r\033[H\033[J", 9); > + write_all(fd, "\033[3J\033[r\033[H\033[J", 13); > } > > solves the issue with the scrollback buffer after log out. > Let me know if you agree that this is the right way to go and I will > send a patch to the maintainer of util-linux. I believe you that this works and you must know better than me whether this solution is correct. Besides that, I'd suggest updating that large block comment before the updated write_all() call to describe the new action you're doing. Please CC me in your discussion with util-linux maintainers. Also I'd suggest coming back in a while, to set this feature enabled by default. I wonder how many years to wait gracefully until "stable" distros update util-linux to ensure secure scrollback wiping. 3? 5? > Thanks again for spending all this time to test the patch! Thank you very much for your time and effort in bringing this useful feature! I give all sorts of my approval on this patchset: Reviewed-by: Andrey Utkin Tested-by: Andrey Utkin