Tput doesn't do most of the things it's expected to do leaving you with no way to set bold or color from a script. this breaks all scripts that use color for errors coming up from freebsd 8 or earlier, where it worked. example tput setaf 1 should set the text to red, which it does on freebsd 4,5,6,7 and 8 (I don't have 9) and does not work on 10,11,12 tput setaf 1 |od -c shows that it puts out SOME codes and then fails.
FreeBSD tput uses termcap names (not the ncurses application). You may have installed the ncurses (terminfo-based) port on the other systems. Try #!/bin/sh for n in 1 2 3 4 5 6 7 do tput AF $n echo color$n done
This appears to be the same as bug #210858.
You might find this helpful: http://invisible-island.net/ncurses/man/tput.1.html#h2-HISTORY http://invisible-island.net/ncurses/man/tset.1.html#h2-HISTORY Since the premise for the bug report is incorrect, it should be closed.
Julian, Can you please comment?
After reading more I came to the conclusion that my bug is misnamed and the problem is that FreeBSD uses what has become a less and less used variant of tput. Ironically we actually have the *OTHER* tput in our sources as well. (in the ncurses sources). To me it seems odd that we can't get both names sets understood, and it's most annoying when scripts from elsewhere don't work on FreeBSD. I'd rather have a more standard tput, but at least it's not as bada s I had thought because I couldn't get ANY colors, but the example above at least gives me that. I think we should follow netBSD and switch tputs. but I'm sure it's more complicated than that.
Sure - it's more complicated: - There's at least one case where there's a termcap name which corresponds to a different feature in terminfo. Otherwise, ncurses might just have accepted both/either depending on the platform. - NetBSD chose to write their own tput (though they're using a copy of the terminal database from ncurses). You can take it for granted that NetBSD's tput will be different in some way from ncurses.
FreeBSD >= 14 defaults to terminfo. Both "tput setaf 1" and "tput AF 1" will work. https://cgit.FreeBSD.org/src/commit/?id=61f66a1f4403fded9aae14d890ad96914a3c0bc1 https://cgit.FreeBSD.org/src/commit/?id=2a50a9de8340f08bd876e9e5993332ae14376f80