18

My bash does not know the letter p. zsh does though.

When I type a p in bash, it simply ignores it, and even pasting in text that contains a p will result in no p in the pasted text. This behavior is the same across terminals (I tried, urxvt, st and tty)

I tried commenting out everything in my ~/.profile, ~/.bash_profile and ~/.bashrc, the problem still persists. Using root though, everything is fine. My /root/.profile, /root/.bash_profile and /root/.bashrc are symlinked to the files in my home directory. So the problem can't originate there, but it's got to be something that is different for root and my user.

I use a custom keyboard layout, but when I switch to standard US keyboard layout, the problem still persists as well.

Just to rule this out as well: I do not use gnome.

Where else can I look?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
maddingl
  • 554
  • 1
  • 6
  • 20
  • 3
    Is there any `.inputrc` in effect? – choroba Jun 07 '19 at 09:07
  • 1
    ha, yes, that's it! I had this left in there: `# fix not working delete-key, see https://git.suckless.org/st/file/FAQ.html # line 51 # printf '\033[?1h\033=' >/dev/tty` I'm using urxvt again anyways, so it doesn't matter – maddingl Jun 07 '19 at 09:12
  • That was easier than I thought :) If you make your comment an answer, I can accept it – maddingl Jun 07 '19 at 09:14
  • Been there, done that :) – choroba Jun 07 '19 at 09:16
  • 3
    @maddingl could you copy that content into the answer. This would be a very good one for future readers! I understand this was something you might have done yourself but it's good for people to understand cause -> effect. – Philip Couling Jun 07 '19 at 09:17
  • That `printf` command doesn't belong in `~/.inputrc` which doesn't understand commands such as that. It should go in `~/.bashrc` or similar shell startup file. – Dennis Williamson Jun 08 '19 at 00:07
  • Symlinking root's shell startup files elsewhere is a security issue. – Dennis Williamson Jun 08 '19 at 00:08
  • Protip: *Any time* Bash's input system is "broken" and Zsh's isn't, it's probably a GNU Readline problem (as in this case). Zsh has its own input system (ZLE) that has nothing to do with Readline. – Kevin Jun 08 '19 at 03:31
  • @PhilipCouling Don't suggest new users to perform major edit on other people answers. You should instead have suggested the OP to write their own answer. – Giacomo Alzetta Jun 10 '19 at 07:06
  • @GiacomoAlzetta: That's not what was suggested. I'd probably word it a bit differently, "into an answer" - but English is my second language, so I'm not sure. – choroba Jun 10 '19 at 07:18
  • @GiacomoAlzetta Adding a new answer would be totally inappropriate, the information added is **NOT** a new answer but a clarification of the existing one. To quote the help center on this: [When should I edit posts? ... ... To include additional information only found in comments, so all of the information relevant to the post is contained in one place](https://stackoverflow.com/help/editing). Adding new answers saying "thank you this was the problem ... because" is actively discouraged on stack exchange. Such posts are frequently flagged and deleted. – Philip Couling Jun 10 '19 at 09:01

1 Answers1

19

Besides the files you mentioned, there could be .inputrc in effect that changes the interpretation of the p key.

Edit: maddingl (the OP) confirms:

That's it. I had left the following in there:

# fix not working delete-key in st, see https://git.suckless.org/st/file/FAQ.html
# line 51
printf '\033[?1h\033=' >/dev/tty

That line does fix the delete-key in st, but it also causes the described problem. I went back to urxvt anyways, so for me it does not matter. If the reader is using st and wants both working p and delete, see the above mentioned link for more info.

choroba
  • 45,735
  • 7
  • 84
  • 110
  • 4
    @maddingl I don't think your edit was warrented. First of all: don't write edits using first-person. Edits should fix errors or add *small* amounts of information. IMHO instead of editing this answer you could have added your own answer instead. – Giacomo Alzetta Jun 07 '19 at 10:54
  • 4
    @GiacomoAlzetta: Let's not treat new users with conflicting demands. maddingl was asked to do it this [this commend](https://unix.stackexchange.com/questions/523494/bash-does-not-know-the-letter-p#comment967951_523494) on the question above. – user000001 Jun 07 '19 at 19:07
  • I think the comment was suggesting that @maddlingl write his own answer, but it was written unclearly. – Barmar Jun 07 '19 at 22:08
  • @Barmar Yes, that's what I meant. If a user edits someone else's answer/question they should do so in an "integrated manner", not like "Hey, different user here. This is what I did ...". At that point they should simply write their own answer and add a reference to the other answer. – Giacomo Alzetta Jun 10 '19 at 07:05
  • @GiacomoAlzetta please don't encourage people to write new posts inappropriately. Answers are for *new answers* not further clarification of existing answers. – Philip Couling Jun 10 '19 at 09:06