Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to divorce my input from the overall shell using Screen? What I'm aiming for is akin to a status line that expands if I type more than would fit within a single line and is 'submitted'/'sent' to the shell when I press enter.

I'm looking to put together a simple configuration to use as a MUSH/MUD/MUCK/MOO client using screen+telnet. The current issue with using telnet is that data sent from the remote server is inserted at the cursor position, which sucks badly if you're typing a lengthy paragraph.

share|improve this question
    
I don't understand your last sentence. Do you mean that the server can send data at any time, unlike the usual shell interaction model where you're either typing a command (at a prompt) or receiving command output (between prompts)? –  Gilles May 12 '11 at 7:12
    
Indeed; if you telnet into a raw TCP/IP service (esp. one that is multi-user like a MUSH), then as you are typing the server may send additional text to you which will get inserted at the cursor, part-way through what you are typing. –  GothAlice May 12 '11 at 18:09

2 Answers 2

A good architecture would be to divide the screen into two windows, one for command input and one for program display. That's basically what a normal MUD client would do. You can do that in Screen with the split command (C-a S).

Create a named pipe to transmit your input from the input window to the telnet window: mkfifo mud-input-fifo. In one of the windows, run telnet mud.example.com 1234 <mud-input-fifo or nc mud.example.com 1234 <mud-input-fifo (nc is netcat, the Swiss Army knife of networking). In the other window, run rlwrap tee mud-input-fifo (rlwrap provides line edition to any line input program).

Emacs could do that too. But you'd end up implementing a MUD client in Emacs, which has been done before (mu.el, mud.el, mudel.el, eMUDs, …).

share|improve this answer

This doesn't do what you are asking, but on many systems (including linux and most BSDs) you can set a key for the "rprnt" action:

 stty rprnt '^R'

and pressing the key while in a program that is using the tty driver for input processing [which I think telnet does when you are connected to a raw service like this] will cause the input line to redisplay on the next line

So your screen will look like:

SERVER PROMPT> your text your text your text your textOUTPUT FROM SERVER^R
your text your text your text your text your text_

Beyond that, you'll need to get a real MUD client like tinyfugue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.