Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634AbcKWReO convert rfc822-to-8bit (ORCPT ); Wed, 23 Nov 2016 12:34:14 -0500 Received: from mout.gmx.net ([212.227.17.20]:61614 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752353AbcKWReL (ORCPT ); Wed, 23 Nov 2016 12:34:11 -0500 Message-ID: <1479922435.5446.13.camel@gmx.de> Subject: Re: [PATCH v5 2/2] console: Add persistent scrollback buffers for all VGA consoles From: Manuel =?ISO-8859-1?Q?Sch=F6lling?= To: Adam Borowski Cc: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, jslaby@suse.cz, gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, andrey_utkin@fastmail.com Date: Wed, 23 Nov 2016 18:33:55 +0100 In-Reply-To: <20161121201704.GA29655@angband.pl> References: <20161118005309.GC26324@dell-m4800.home> <1479679088-3015-1-git-send-email-manuel.schoelling@gmx.de> <1479679088-3015-3-git-send-email-manuel.schoelling@gmx.de> <20161121201704.GA29655@angband.pl> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:hWSAYcO4So5OLPP/lKwC1UJUCGm6/EHJ7PtUMaGSCrT53ZdeTTS eIEKL/6J8FNmoaJobrAqK/dyjp2kizh91yfu27iaMO7xDUT1tAmTdvxAJr2tVH54yXWm4cY RAHuTulF5hfDRS4ZCWfFOrEjIJNGRfyvAvJEQ6Jcmz3IFV7vDdOZEDMZw/uDVWqRhtY+8oP fJ4mo8FJzqG/jNzl6ojDw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Gu4N4DRB14k=:oPlFR1hjxnbG6XmbFyv/IG mCtdmw89NqTcUv4jjT7xbEGVNYfRT6WEsnFe7rYqAHoyLOPJAd31UQVvh9nMtbPKf8beurxjf 2Svj5WfwbvPYzzK9j8J3pqwy3zg9HNKoSOa49u6tb1SlDry8TbcvaR5Pir1VZBGOzhVB5y/aE IqfTu/QmouU3eHPtVQfGLZfuRG/paUuXJyCakgUYdDxen10QUm0YAEnZMvFT2rpQhUAvV8e+C oBxEkQDp34s8IYGjdfVUmgf/Q5ZVUy+VFblff6QJdcr6jlRns0zBalBouCU8fmMN0lwZvqGk1 ZDUCE1BdsA+Y1zmAF+1FEHovWsv4sFdMoT2nVurs5BJrwepsQ5t0VF9FiO8YMJb5VmpyjIHm/ GXBl5COwcW5oY8ntMNhC/Rz2Xz03jSCEvdsx8t6YR64UumjhwtjXXfDy9AnM5+Io/hheNAAB/ 250G+CBXtuIs9jgZt9evymca/N/JDyPfEk02RUgO8E/WSNrSIxLmRta9ZrZvhzcbBXe45n1QM /MMsIv7Pmloa0jyuy3q/vnQcZ8Iusbb3WKa+21Ih6cUv6X7a4zbvToKM/qxSjVQcc1T1OVKUy hWoKFm8CI0Jkuq1UwiaYhzS5U/DZqLXqd1mtDmgbZQfGhJXVl/GVLF9gyQ7rLqRPP9M2ASIzD ewPkDoK7zuexZGTuE33T2j1VjNZY1VaWGexyspZKJktsi95mfGq1L/0MMEbG6iFeWUWgMDSsq BWE5FHLWAgE+MCn2vSRIfYYIMMxvHlVQIIXhOv9llBtkSP+zfAYM5QjA8fpi7E5Q+tSZIdamv Na2Jbof Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1468 Lines: 28 On Mo, 2016-11-21 at 21:17 +0100, Adam Borowski wrote: > On Sun, Nov 20, 2016 at 10:58:08PM +0100, Manuel Schölling wrote: > > Add a scrollback buffers for each VGA console. The benefit is that > > the scrollback history is not flushed when switching between consoles > > but is persistent. > > The buffers are allocated on demand when a new console is opened. > > > > This breaks tools like clear_console that rely on flushing the > > scrollback history by switching back and forth between consoles > > which is why this feature is disabled by default. > > Use the escape sequence \e[3J instead for flushing the buffer. > > > > Signed-off-by: Manuel Schölling > > --- > But alas, this commit breaks that very \e[3J. It does only a \e[2J, leaving > the scrollback uncleared. For comparison, both mainline and with just your > preparatory commit, \e[3J works as expected. Thanks again for reporting this issue. I was finally able to reproduce it. Looks like the same problem arises when implementing persistent scrollback buffers for framebuffer consoles. I will have to think about the underlying issue a bit more, but I guess that the consw struct needs another field for a function that flushes the scrollback buffer. Before this was just done by switching the console, which is fine if you just have one buffer. But now each console has its own buffer, so simply calling vc_data's vc_sw->con_switch() won't be sufficient anymore.