Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754919AbcK2QfX (ORCPT ); Tue, 29 Nov 2016 11:35:23 -0500 Received: from mout.gmx.net ([212.227.17.20]:51851 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbcK2QfP (ORCPT ); Tue, 29 Nov 2016 11:35:15 -0500 Message-ID: <1480437302.2848.8.camel@gmx.de> Subject: Re: [PATCH v7 0/3] console: Add persistent scrollback buffers for all VGA consoles From: Manuel =?ISO-8859-1?Q?Sch=F6lling?= To: Andrey Utkin 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 Date: Tue, 29 Nov 2016 17:35:02 +0100 In-Reply-To: <20161129100115.GA20034@stationary.pb.com> 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:taN8Dz3rhGHXTD09xEGUEqwDfwYkmURZs6PSEhrF9huDYXYYv3P AhESXvwBt95dBBscoaH3kqF9pJDSurMskomGID1MqxZ+AVNeEPeUjDYAXI0c2yKXdhfyLIj /LTTFs4UJbIV1mrITqS25kT2cfXaz1NJuMcscTxx5YbQmK9Uq1vWXks1l7wFpMF0JTRqqT2 YXKvRSA3AxtftcHL6r4+g== X-UI-Out-Filterresults: notjunk:1;V01:K0:iWWyOgIagwQ=:vkTbTLBbFYqJBmMnnSrYLh WUJZjnORryEX4LbHzQZrND0IcrzhxpY2UVKE2aAYRh//xJt2ex6oDQ/zppTE4i482rOuWb3uQ oAjvxlQCLPsVXjHM7J744fW1n8N6sY6ZYgqZFaN3SYWMePwGrOSN6q/9WJ7Dfo/XWYg/3Bo5U 5xCPhpXliAqC9mRklSmx0zz8llgX0sf7pzNVxubGtwJc7TkwgAdCiGMldkDjk6U52Ks+ai9kN s8bmR+5gvqAn4hM6Y73Ll1/5gmciw0CGkamFPHvv6h+o76zq0YwIwjYFiLU2NZROMO13ZboN5 XEtD85L/S7zvQtNLsyjHQj5JefrTidxHrhhOjFjoHFk4hVNW+iKs/bdRr3VzmvetQy7jjEeHT Wj4JCXu+VAEciPNRh24Ts25NZtqWc+Mc3dVdBm/2DFXMGIIjK4UL1y9BW+hQBJVouWZvYQs9R 1vB3XgzxK0J7W8RWr6/q6s7SC4hhTwztp7kaeTmOkOp/tZDFBplP8ND3xrk/Sn295WGstxN+M 8hG+RXfjw7naZ/kD4DTiYEhJM7/u5xZFYWCHjdZ++WYgevt0RkC2URjZJvzZdyy6OJob3dDGB nwIZ8GtAyeVg3xB3BkO4FrKFL7Pi5TVME4Q0Y2Uo9N+GJkJBa91hAoP5jL2qvHbTbd8YaW+5M PFEb7xO+lN0QePCToFYqR+Y8Hc3kKyiS2OvvREi0rCXViH/FlYFFfaah04zyJP5Oq7bdqgtiP jG9yniSBb7ib83FxiHwqFQVRRFyLe07cvP63BHWRyB+mCDGIWGBgRiYP8zNavuRxGNm8nte4R +yp5c0n Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1559 Lines: 43 Hi Andrey, On Di, 2016-11-29 at 10:01 +0000, Andrey Utkin 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. Are you sure ncurses is involved at all? My Debian agetty(8) manpage says: -J,--noclear Do not clear the screen before prompting for the login name (the screen is normally cleared). And digging into the source code of agetty shows these lines [1]: 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); } So I guess that agetty relies on on switching the console for flushing the scrollback buffer and we'd had to add the \E[3J sequence here. Note that up until now I just had a look at the theory (manpage and source code). I'd need some days to find time to show at runtime that this really is the reason why the buffer is not flushed. Bye, Manuel [1] https://github.com/karelzak/util-linux/blob/master/term-utils/agetty.c#L1175