[Pkg-kbd-devel] openvt opens numberless tty, incompatible with chvt

Ryan Pettigrew tenacious-techhunter at protonmail.com
Tue Aug 7 18:32:07 BST 2018


When openvt opens a Virtual Console, there’s a good chance that it will open the tty with no number at all. This becomes a problem if some other software switches the view on you; it has no f-key, and if you are running a script, there’s no number to give to chvt to return you to openvt’s Virtual Console.

I humbly suggest that chvt be modified to accept both no argument and an empty string as an argument; this will allow script writers to copy the current Virtual Console number by copying the value in tty, and filtering out both the string with the path and "tty", and then feeding the result to chvt; a common naive attempt.

I also humbly suggest that other software should, at least as an optional argument to openvt, be suspended from or refused the ability to switch view without confirmation from the super user. It’s really disconcerting to be running a script as root, only to see the view spontaneously switch to the GUI at Virtual Console 7, and not by any direct action on your part.

Another fallback option would be to prevent openvt from opening numberless "tty"s in the first place. This may have undesireable side-effects.

I’m currently boxed into a corner in my scripting; I presumably have to pick a default Virtual Console number to feed both openvt and chvt, and ask the user if he has a preference otherwise, in the unlikely event of a conflict, which the end-user is unlikely to be aware of anyway, which means I need to test whether openvt was successful at finding an unused Virtual Console at the specified number, or whether it was busy. Is there a recommended Virtual Console number for this purpose? Are there Virtual Console numbers it is recommended to avoid, such as number 7, which frequently holds the GUI?

Ryan Pettigrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-kbd-devel/attachments/20180807/5a6a654c/attachment.html>


More information about the Pkg-kbd-devel mailing list