Score:0

How to check for Sixel support in pam_motd on Ubuntu?

gb flag

Ubuntu uses pam_motd to display the message of the day (motd) when logging in. This message is in turn generated from the scripts in /etc/update-motd.d.

Inside one of those scripts I would like to check if the terminal used supports Sixels.

I tried using the LC_TERMINAL variable, but it is not set yet. I also found out that printing a control code with echo -n "\u001B[0c" allows to check for Sixel support, but I have found no way to capture and examine the output in the script. I also do not know if this even would work inside a script run by PAM.

So

  • Is there a way to get LC_TERMINAL passed to the script when logging in with SSH?
  • Is there a way to capture the output of echo -n "\u001B[0c" in the motd script and examine it?
  • Is there any other way to check for Sixel support in the motd script?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.