How can I start some command for certain tabs in screen automatically?

I've tried using command directly (screen mc) but it seem to load with broken environment or terminal profile. I've also tried using stuff command which seems to do what I need except for missing enter: if I write stuff mc I see letters mc in correct tab, but in order to execute it I have to press enter manually. Is there way to do it automatically? Or, for C programmers, what's the stuff equivalent for \n?


From the man page:

screen [-opts] [n] [cmd [args]|//group]

So to run mc on startup, your .screenrc should contain at least

screen mc

If your terminal settings are broken, it may be that your system does not contain a entry for screen in the terminal database. In this case, you could try telling it to treat screen as a VT100 with this alternate configuration file:

term vt100
screen mc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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