What I mean by that is when a program is running (let's say, telnet), any inputted text gets lost when something is written on the screen. For example, on a chat server,

I type

> Hey, I'd like to ask y

Suddenly I receive a string, and now my screen looks like this

> Hey, I'd like to ask yHey, what's up?

I can still continue to write and hit return to successfully send the string, but I'd like to have my input move down like so

Hey, what's up?

> Hey' I'd like to ask y

How can I do that? I use bash and lxterminal

UPDATE So here's a quick and dirty solution: anytime your input gets lost, press ^R to recover it.

  • It's the same problem, but it's not solved.
    – Manheim
    May 14, 2020 at 10:08

1 Answer 1


Version 2

Version 1 (below) did not work, as the input went to the parent terminal, but is not processed. So I had another go. We have to have the program run in the input terminal, it gets its input as normal. Then directs its output to the other terminal. I think it should work, but have not tested (no mud server).

xterm -e bash -c "telnet mud > '$(readlink -f /dev/stdin)'"

Version 1

I used to use a separate terminal for input.

Create input terminal by doing:

xterm -e bash -c "cat > '$(readlink -f /dev/stdin)'"

How it works

  • First the readlink -f /dev/stdin determines the terminal you are in. It does this by following the symlinks from /dev/stdin. These are dynamic (they change), depending on the process that looks.
  • The command now looks like xterm -e bash -c "cat > '/dev/pts/x'"
  • Next xterm runs and launches bash that launches cat redirected to this terminal.
  • It's a great idea, thanks for sharing. Can you please explain how it works?
    – Manheim
    May 14, 2020 at 13:41
  • Thank you for explaining it!
    – Manheim
    May 14, 2020 at 14:57
  • I just tried it out, and it doesn't work. The input is sent over, but it's not registered. If I input "man tty" it's printed without any action. The same is true for telnet. I tried both xterm and lxterminal. I'm on archlinux. Any ideas?
    – Manheim
    May 14, 2020 at 15:11
  • Oh Yes. Now you point it out, it is obvious. I will have another think. May 14, 2020 at 18:09
  • It works! It works with lxterminal and with xterm. Thanks again!
    – Manheim
    May 16, 2020 at 8:53

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