2

I'm setting up my screenrc to open several tabs and already insert commands such that I only need to press enter to start some process.

Here's an example screenrc:

screen -t test
stuff hello

However, if I start screen, the text "hello" will appear twice, because stuff is executed before the shell has loaded. This is what it looks like with my shell and the above screenrc:

screen session

How can I avoid the first "hello" shown in the terminal before the shell has loaded?

6
  • Is this an end in itself? If not, what larger goal are you trying to accomplish?
    – Fox
    Commented Jul 19, 2017 at 20:00
  • Yes, I simply don't like the clutter.
    – morxa
    Commented Jul 20, 2017 at 14:17
  • But are you trying to run a command (in which case you don't need stuff), to just print a thing (in which case .bashrc seems sufficient), or something else?
    – Fox
    Commented Jul 20, 2017 at 20:33
  • The goal is to have a screen session that fills a number of tabs with predefined commands so I only need to press enter to start. I don't want anything to start automatically, but I also don't want to type the commands manually. If there's an alternative to stuff, I'd be happy to use it
    – morxa
    Commented Jul 20, 2017 at 21:53
  • I'm not in a place where I can test this, but something like (as a line in the screen rc file) screen sh -c 'echo some-command; read && some-command; sh' should allow a pseudo pre-filling, cancellable by ctrl-c
    – Fox
    Commented Jul 20, 2017 at 22:01

0

You must log in to answer this question.

Browse other questions tagged .