0

I'm running Raspbian Buster with no Xserver but attached to a television. I have a script that writes an image to the framebuffer from a timed systemd service.

The problem is /dev/tty1 is writing its blinking cursor (with black character sized box) that appears over the image. I would like to prevent /dev/tty1 from writing to the framebuffer in a safe manner. I suppose if I lose SSH access I would need to use /dev/tty1 to recover machine.

2

Try making the cursor invisible with the civis terminfo escape:

tput civis > /dev/tty1

tput cnorm to restore it.

I suppose if I lose SSH access I would need to use /dev/tty1 to recover machine.

Doesn't that device have any serial port? That's a bit more robust than a framebuffer console.

  • With sudo tput civis > /dev/tty1 I'm getting "/dev/tty1: Permission denied". What do I do with a serial port? I can just connect a USB keyboard to connect to tty1 no? – deanresin Aug 12 '19 at 2:23
  • 1
    That will not open /dev/tty1 as root. I'm not using sudo (ever!), but try sudo sh -c 'tput civis > /dev/tty1'. – mosvy Aug 12 '19 at 2:26
  • Great it worked. Why did I need "sh -c"? – deanresin Aug 12 '19 at 2:32
  • 1
    In your command, it was the current shell (running as as regular user) tha opened /dev/tty1, not the command run under sudo. – mosvy Aug 12 '19 at 2:38
  • 1
    You simply need to have write permissions to /dev/tty1. Usually only the root and users from the tty group have permissions, and the user logged in in that terminal. It doesn't matter if the user is a sudoer or not. – mosvy Aug 12 '19 at 2:48

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.