I have a problem where when I execute commands such as "systemctl status" , output is written on to previous lines of bash output . normally output is written some 20 lines above the current line... PS1 does not seem to be the issue since I am using PS1=$ to keep it simple . Also tried solution mentioned in :

Bash overwrites the first line, PS1 bash prompt

I am using putty to connect to ubuntu on a embedded target . I do not see this problem for e.g if I do a "cat" on a file .

  • Unclear what you're asking, maybe add a screenshot ?
    – steve
    Oct 17, 2016 at 21:43

2 Answers 2


The question is too vague, but I would check:

  • check the terminal (TERM) and in the setting of your terminal. They should match, but it is also preferable to use some of the standard ones (and the system should have installed support for such terminals).

  • Check the font. Also in this case, try a common font.


You would see this behavior if systemctl status initialized the terminal (as if it were displaying a full-screen application), using the old-xterm smcup and rmcup terminal capabilities. You can see those with infocmp, e.g.,

smcup=\E[?47h, rmcup=\E[2J\E[?47l,

Those save/restore the cursor position before/after switching to/from the alternate screen. If you have disabled the alternate screen feature in putty, the save/restore cursor escape sequences still take effect.

A correctly implemented new-style smcup/rmcup disables the cursor save/restore when the alternate screen is disabled (I don't recall if this is implemented correctly in putty...).

Further reading:

You must log in to answer this question.

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