1

Recently, more and more GUI applications (okular and inkscape, among others) started disabling terminal echo while they are active. This seems unnecessary at best (if you don't background the process, you wouldn't type in it anyway and if you did, who cares? And if you background it, it has no effect anyway). But what is worse is, that if you happen to do something wrong and instinctively kill it with ctrl-C (I do that if I accidentally call okular on many files, for instance), the echo stays disabled. It's not the end of the world, but needing to blindly type stty echo every time this happens is making me nervous.

Is there a way to tell the terminal to disable toggling these settings? I think it might be possible to modify the termcap but that's where my knowledge about it ends. Of course, this probably makes invisible password visible but I want to know how to do it anyway, having one tamper-proof terminal open would be enough.

0

1 Answer 1

3

echo is a setting of the terminal device (the discipline part in the tty kernel driver), termcap is about controlling the terminal (real or emulator) via escape sequences, it's two separate things.

Here you want to prevent the application to do a specific ioctl. One way could be by detaching it from the terminal.

socat - exec:okular,pty,raw

Would run okular attached to a different pseudo-terminal device and socat would pass along data from your terminal to that one.

To pass arbitrary arguments, with zsh:

okular() {
  CODE="$0 ${(j[ ])${(qq)argv}}
       " socat - 'system:"eval \"$CODE\"",pty,raw'
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .