gdb: Make startup message more user friendly
Currently, on startup, GDB prints a lot of licensing information and
then a few hints for new users. While there is an attempt to separate
the hints from the rest of the text, my user testing showed that it is
not good enough, and most unfamiliar users will just skip the
information. Especially considering that the documentation link happens
before the separation.
This commit attempts to make the startup message more friendly to new
users by visually separating the most important commands from the
copyright. If there is enough space available, a box is printed
containing the hints (either using unicode box drawing characters, if
emojis are allowed, or using ascii). If there isn't space for a box,
a simple line separator is printed. The code deems "enough space
available" when there is enough space to print the documentation URL
inside the box, since the other hints will be broken into multiple
lines if necessary.
Here are examples of the 2 possible startups, with enough space:
+-----------------------------------------------------------------+
| Find the GDB manual online at: |
| http://www.gnu.org/software/gdb/documentation/ |
| For help, type "help". |
| Type "apropos <word>" to search for commands related to "word". |
+-----------------------------------------------------------------+
And with limited space:
---------------------------------------------
Find the GDB manual documentation resources o
nline at:
<http://www.gnu.org/software/gdb/document
ation/>.
For help, type "help".
Type "apropos word" to search for commands re
lated to "word".
Approved-By: Tom Tromey <tom@tromey.com>
3 files changed