Hello,
This bug report is a summary of bugs 537696, 644996, 644997 and 683462
exhibiting variations of the same problem.
Fbi is an application that applies only to the linux console with a
kernel that supports framebuffer device. He does not accept to run in
pseudo-terminals (pts, tmux, screen...), over SSH or without the framebuffer
device.
So programs that bases on the mime type and mailcap could easily call Fbi in
the wrong context. Currently the mailcap is:
image/jpeg; fbi '%s'; test=test -z "$DISPLAY"; needsterminal;
The proposed solutions are:
a) (537696: Trent W. Buck)
A crappy but simple extension is to check for the screen session (STY) as
is done for the X session (DISPLAY):
image/jpeg; fbi '%s'; test=test -z "$DISPLAY$STY"; needsterminal;
b) (537696: Trent W. Buck)
test -z "$DISPLAY" &&
( test 0 -eq $EUID ||
fgrep -qx `tty | cut -d/ -f3` /etc/securetty )
This case needs some other change, as running fbgs as root in an xterm
doesn't work either (Vincent Lefevre).
d) (644997: Vincent Lefevre)
Fbi should provide a binary that would only test whether fbi can work by
doing a "ioctl VT_GETSTATE". That would avoid guessing what test to use and
would be more reliable.
Personal conclusion:
(a) is to be rejected, (b) is a good start but (c) is better. (d) seems to be
the ideal solution (add a Fbi "--testmailcap" option), but it would be better
to find a solution independent of the software (another example: links -g).
I therefore propose as a first step the following solution, an improvement
of (c), which takes into account whether the framebuffer device is available
(change mailcap file fbi.mime of the package):
image/*; fbi '%s'; test=test -z "$DISPLAY" -a "$TERM" = linux -a -c /dev/fb0; needsterminal;
Regards,