The first problem I realized was this topic, but I marked it solved when I found a workaround and there were no responses.

The second problem I noticed is that when I'm logged in as root, if I run man, instead of accepting input and scrolling pages (or whatever I told it to do) the key code would be displayed where the page number was.
I.E. I hit [Down] to scroll down one line, but instead...

Code:

lines 1-57

turns into

Code:

:^[0B

I can backspace it away, and I can type, but It captures all my keyboard input and I cannot close the man page. I even just tried it in a tmux shell run as sudo, and I could not even 'C-a x' which should force tmux to close the terminal.

The third problem, that I just noticed the other day, is that gnupg doesn't work. When I run gpg I get the following:

Code:

% gpg --gen-key
gpg (GnuPG) 2.0.19; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: cannot open `/dev/tty': Permission denied

If I run the command as root the behavior varies depending on the kernel console= option:
If kernel... console=tty1 then I can see the output and type input into tty1 (Ctl-Alt-F1)
If I do not specify console= then I cannot see the output or input in any of the 6 tty's or the pts I ran the command in. I believe I discussed having similar behavior in the above thread.

I have no idea what is happening, or what information is relevant, so I'll give some of my system information here, more info available on request.

Sounds possibly like a missing kernel config option - try turning on more options related to tty handling. I doubt something like that would be broken in udev but there's a side chance of that as well.

Has the problem recently appeared (if so, any system package upgrades that might have affected it?) or could it have been like that a while?

I've had the problem since installing KDE. Actually the man page problem happens even in tty. I've upgraded Udev since initial install and the problem persisted. sys-fs/udev is version 200, virtual/udev is 197.3.

A quick search for tty in the kernel menu config shows everything with tty in the name being =n. The problem is that I don't know what needs to be changed.

The second problem I noticed is that when I'm logged in as root, if I run man, instead of accepting input and scrolling pages (or whatever I told it to do) the key code would be displayed where the page number was.

ShadowHawk92 ... I think there may a number of seperate issues here, and for that reason its difficult from your report to point at the 'cause' and provide a solution.

My first stab in the dark would be to ask if you've tried another terminal, and if the same issues can be reproduced, this would rule out kconsole, and narrow down the scope. Also, can it be reproduced in the console?

ShadowHawk92 wrote:

I can backspace it away, and I can type, but It captures all my keyboard input and I cannot close the man page. I even just tried it in a tmux shell run as sudo, and I could not even 'C-a x' which should force tmux to close the terminal.

Your shell will interpret the keycodes sent via the keyboard in a certain way, ^? or ^H (for stty erase) being one example. This is true for other keys such as 'page up', 'end', etc. So, does the keymap you provide represent the keyboard, and does KDE (in whatever "keyboard" preferences) show the same keymap, ie: keymap=us. Also, when using tmux the terminal is being reported to tmux, so what does kconsole say is the TERM and what does tmux think it is? The value of TERM will effect the termcap used, and so how the shell understands keyboard input.

ShadowHawk92 wrote:

The third problem, that I just noticed the other day, is that gnupg doesn't work. When I run gpg I get the following:

Code:

% gpg --gen-key
gpg (GnuPG) 2.0.19; Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: cannot open `/dev/tty': Permission denied

Does the following produce the same error?

Code:

% GPG_TTY=$(tty) gpg --gen-key

Infact ... what does the output of 'tty' show?

ShadowHawk92 wrote:

If I run the command as root the behavior varies depending on the kernel console= option: If kernel... console=tty1 then I can see the output and type input into tty1 (Ctl-Alt-F1)
If I do not specify console= then I cannot see the output or input in any of the 6 tty's or the pts I ran the command in. I believe I discussed having similar behavior in the above thread.

Why are you passing console=tty1? ... unless you need to send to a serial line then using console= is not necessary.

ShadowHawk92 wrote:

I have no idea what is happening, or what information is relevant, so I'll give some of my system information here, more info available on request.

Its really hard to see what might be the issue, you should probably post your kernel config, and init from the initramfs. CONFIG_UNIX98_PTYS is enabled?

I'm having to type this from my phone, I appolagize for spelling errors in advance.

Khayyam,

The problem with man pages is reproducable in a tty. I went ahead and installed another terminal emulator anyway (yakuake) to test in also.

Running

Code:

sudo man gpg

in yakuake (without tmux) had the same input error. Before I gave it any input there was just a colon where the page numbers should have been. Giving it input showed me the key codes after the colon instead of scrolling.

In konsole TERM=xterm;
in yakuake TERM=xterm;
in tmux TERM=screen-256color

So your initramfs is that built with genkernel with the suggested changes from the wiki.com howto? Have you tried to boot without this, and with a non modified kernel? I suspect this to be the prime candidate for why the tty is not rw for your user, and that the subseqent issues are the result.

My initramfs is not built with genkernel, it is most similar to this with the fbsplash modifications I linked to earlier. I also added GnuPG 1.4.11 to the initramfs. I can download gentoo-sources and compile it with genkernel, but my whole hard drive is encrypted with boot on a usb drive so I have to have an initramfs to decrypt the hard drive. Actually, genkernel has support for a cryptsetup, gpg, lvm initramfs so I may be able to genkernel a working initramfs and try that.

I'm emerging genkernel and gentoo-sources now. Will (try) to use genkernel to compile the kernel and the initramfs and will report back with the results.
Also if you want I can post my current initramfs init script.

I forgot how much kernel customization I had to do to get my system set up. Any how, a large number of kernel compiles and reboots later I finally got a genkerneled gentoo-sources bootable, albeit with my custom initramfs and I'm having the same problem.
So the kernel isn't the problem.

I have a line in my initramfs:

Code:

cp -a /dev/console /dev/tty

So that gpg will work in the initramfs. I'm wondering if this is the problem so I devised another work-around that I'm about to try.

Also, because of my setup, I don't think a genkernel initramfs will ever work right, but I can use the shell when it fails to (hopefully) boot, and test that.

I'll let you know what I find out, but any other suggestions would be greatly appreciated.

- Shadow

EDIT:Removing the above line from initramfs fixed all the problems and created a new one (or emphasized an old one I hadn't noticed.)
But first, to clarify, the problem with man pages works, gpg --gen-key works, and sudo works without the -S option; all in tty, pts, and tmux.

The (new) Problem: On login, yakuake starts automatically and grabs pts/0. However, something else (I don't know what) grabs pts/1. If I start Konsole, it grabs pts/2.
Konsole (pts/2) can't read in my password. I can't use sudo, or su. I can use Ctl-C and exit the password prompt from sudo, but not su.