BBB with HDMI monitor - shell prompt draws off screen

I have a small monitor connected to the BeagleBone Black.

I am using the console image from


I am experimenting with the framebuffer, and I caught that the resolution was incorrect. Here’s the code:

struct fb_var_screeninfo vinfo;
ioctl(hFrameBuffer, FBIOGET_VSCREENINFO, &vinfo);

int nFrameBufferWidth = vinfo.xres;
int nFrameBufferHeight = vinfo.yres;
int nFrameBufferBitsPerPixel = vinfo.bits_per_pixel;
int nFrameBufferBytes = nFrameBufferBitsPerPixel / 8;

printf("nFrameBufferWidth=%d\n", nFrameBufferWidth);
printf("nFrameBufferHeight=%d\n", nFrameBufferHeight);
printf("nFrameBufferBitsPerPixel=%d\n", nFrameBufferBitsPerPixel);
printf("nFrameBufferBytes=%d\n", nFrameBufferBytes);

Here’s the original output:


I believe the EDID of the display is not configured. To remedy, I changed /boot/uEnv.txt by uncommenting the line that sets the video resolution in the cmdline:

#In the event of edid real failures, uncomment this next line:
cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:800x600@60e

Now, the framebuffer size correctly reports x and y resolution:


Unfortunately, despite the framebuffer resolution now reporting correctly, the shell is still acting improperly.

debian@beaglebone:~$ echo $LINES $COLUMNS
37 100
debian@beaglebone:~$ stty size
37 100

I typed a bunch of characters and counted. The display region should be 30 lines by 100 columns.

Because the system believes there are more lines visible than there actually are, when the console output exceeds the 30th line I can no longer see the cursor or text that I’m typing.

My searches for a cure have all lead to a recommendation to call:

shopt -s checkwinsize

This was already configured, though:

debian@beaglebone:~$ cat /etc/bash.bashrc | grep shopt
shopt -s checkwinsize

Calling it manually has no effect – $LINES is always reported as 37 and never as 30.

Can someone please advise on what additional configuration changes are necessary such that the OS/tty1 will recognize the appropriate vertical space of 30 lines?

Thank you for your help!

My apologies - this turned out to be an easy fix. I had the resolution configured incorrectly for the display. This model isn’t 800x600 – it’s 800 x 480.

1 Like