Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a hardstatus line set in my .screenrc file:

hardstatus alwayslastline '%{= kg}[ %{G}%H %{g}][%= %{= kB}%?%-Lw%?%{+b r}(%{G}%n*%f %t%?(%u)%?%{r})%{-b B}%?%+Lw%?%?%= %{g}%]'
# This is 127 characters

I routinely log in to remote servers that are shared with other users who have their own favourite hardstatus line. I want to change the hardstatus for my screen session by entering it as a command after starting the session. Unfortunately, screen stops accepting input for the command after reaching around 100 characters.

When I talk about screen commands, I mean the ones entered after tying ctrl+a :

Is there a way to increase the screen command character limit beyond 100 characters, or another way to set the hardstatus without altering the .screenrc file? A solution for changing it after the session is started would be preferred, but a command line option when starting screen would be a good alternative if it's possible.

One way to work around the problem would be put the hardstatus line in a file and enter ctrl+a :source <file>, or type this after starting screen:

screen -p <SESSION_NAME or PID> -X hardstatus alwayslastline '%{= kg}[ %{G}%H %{g}][%= %{= kB}%?%-Lw%?%{+b r}(%{G}%n*%f %t%?(%u)%?%{r})%{-b B}%?%+Lw%?%?%= %{g}%]'

But I'd really like to know how to increase the character limit for commands.

Thanks in advance,


share|improve this question
I'm curious why multiple interactive users are sharing a single user account on a system. Such would seem like a security / auditing nightmare. And if that assumption is incorrect, I would ask why you can't modify your ~/.screenrc - Mostly since fixing an issue like this is the specific purpose of that file. Just trying to make sure this isn't an XY problem. – Darth Android Sep 20 '12 at 19:29
There is one user account with the correct environment for running certain jobs. Company policies and processes restrict access to this system, so we can't create additional accounts on it. I could modify the .screenrc file, but someone else set it to his preferences before I started using the system and it would be mean to change it on him. Still, none of this has to do with the restriction on 100 character commands, which is what I'd really like to know how to change. Thanks for the interest though :) – Matthew Sep 20 '12 at 20:49
+1 Respecting other users on shared resources. – Darth Android Sep 20 '12 at 21:33

1 Answer 1

up vote 1 down vote accepted

You can't; the 100 char limit is hardcoded (I think the upper limit is enforced in screen/src/input.c, but function callers may provide a shorter buffer to begin with, so that's potentially not the only place that would need patching).

As a less typing-intensive solution, I recommend adding a .screenrc-DarthAndroid that first calls source .screenrc and then adds your preferred override settings; then, create a shell alias myscr="screen -c ~/.screenrc-DarthAndroid ".

share|improve this answer
I'm accepting this answer for the 100 char limit explanation about the behaviour. As for the second paragraph, I can accomplish this just using a .screenrc file (optionally naming it something else). Thanks for solving the mystery :) – Matthew Nov 13 '13 at 7:42

Your Answer


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.