Tell me more ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Any local terminal text (login prompt, etc) is showing through areas of the screen that are not covered by video (i.e. the black bars on the top and bottom) when I use a remote terminal to play video with omxplayer. If I wait 10-15 minutes, the local terminal goes totally black due to inactivity which fixes the problem, but that's kind of a lame workaround.

I'm thinking that using omxplayer locally would sidestep the problem, but I cant verify since my RPi hates all of my keyboards. I also dont want to play video that way long-term.

How can I black out the local terminal so it doesn't show through when using a remote terminal to play videos over HDMI?

share|improve this question

2 Answers

up vote 1 down vote accepted
sudo sh -c "TERM=linux setterm -foreground black >/dev/tty0"
sudo sh -c "TERM=linux setterm -clear >/dev/tty0"

This will change the font color to black, than clears the screen.

Or in a single line:

sudo sh -c "TERM=linux setterm -foreground black -clear >/dev/tty0"

And set it back to normal:

sudo sh -c "TERM=linux setterm -foreground white -clear >/dev/tty0"
share|improve this answer
That's a pretty good solution. It still leaves a blinking cursor in the upper left corner though. – Wisteso Oct 20 '12 at 20:17
run sudo sh -c "TERM=linux setterm -foreground black >/dev/tty0" before the above command :) – Szindbad Oct 20 '12 at 20:42
that did the trick. I'm concerned about it messing with the terminal when not playing movies (like when shutting down), but that can be a different battle. – Wisteso Oct 21 '12 at 2:26
Please update the answer to include the full solution. – Alex Chamberlain Oct 21 '12 at 8:28
Thanks for the one-liner update, Szinbad! – Wisteso Oct 25 '12 at 4:18
show 1 more comment

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything will be deleted. See Good Subjective, Bad Subjective for more information.

Here is what I do (in a script):

setterm -cursor off;
clear;
omxplayer -o hdmi "video file.mkv" | echo "";
setterm -cursor on;

If you do use a script to call omxplayer, you might want to add

complete -F _longopt watch

to your .bashrc (or similar for whatever terminal you use) so you get filename tab-completion.

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.