TermSize - Release Notes
Copyright 2021-2022 by The Software Samurai.
On the web: http://www.SoftwareSam.us/
Software released under GNU GPL3, and documentation released under FDL1.3
This document describes version 0.0.01 of TermSize.
The ‘TermSize’ application is a GNU/Linux utility built on the NcDialog API (see above) which
helps to compensate for the serious design flaw in the GNOME terminal under Wayland which no longer reports
the terminal-window size as it is being resized.
In addition, there is a serious bug in the GNOME terminal program which calculates the initial size of the
window using a hard-coded 12-point font as the reference. If your terminal is set for a font other than
12-point, you may need to play some tricks to get the dimensions you want.
In addition, the gnome-terminal invocation accepts only a limited range for row/column dimensions juxtaposed
with the dimensions of the desktop area. Again, this seems to be a calculation based on a hard-coded 12-point font.
(Wayland may someday be a reliable platform, but today is not that day.)
(Konsole, on the other hand, continues to report resize events correctly.)
To invoke the 'termsize' utility whenever a new terminal window is opened, create a custom “.desktop file”
and place it where local desktop files are located on your system. This is usually in the directory:
Consult your system documentation to verify the location for desktop files.
An example desktop file is shown, which can be adapted for your system layout.
Comment=custom geometry for terminal (Note: Wayland ignores positioning parameters.)
Exec=gnome-terminal --profile='Sam' --geometry=141x37
-- /bin/sh -c 'termsize ; clear ; exec bash'
Both the application (and its documentation) are quite simple, but we hope you will find it useful.
This application was designed under Fedora Linux and is built using the GNU C compiler,
version 4.8.3 or higher (C++11 support required).
If you are not using GCC, then verify that your compiler fully supports the C++11 standard.
(Note for users of Microsoft Windows(tm), we strongly recommend that you immediately wipe
your system and install Ubuntu 20.04.3 LTS.) http://releases.ubuntu.com/
Building From Source
Download and unpack the distribution archive at the same level in the directory tree as the NcDialog API
source directory (available as a separate download). After unpacking the archive, the directories will
look something like this:
/home/sam/SoftwareDesign/NcDialog/Dialog1 <== NcDialog source lives here
/Dialog2 <== test and demonstration code
/Dialog3 " " " "
/Dialog4 " " " "
/Dialogw " " " "
/Dialogx " " " "
/Texinfo <== NcDialog documentation lives here
/home/sam/SoftwareDesign/TermSize <== TermSize base source directory created here
/TermSize.cpp // Application source code
/GlobalDef.hpp // Specifies '#include' files and general definitions
/Makefile // Build the 'termsize' application
/README // Package description, release notes
- Navigate to the base directory where package will be installed (example):
- Move the archive file to the target directory:
mv ~/Dowloads/termsize-0.0.01.tar.bz2 .
- Unpack the tar archive:
tar -xjvf termsize-0.0.01.tar.bz2
- Navigate to the target directory:
- Build the application:
‘rsync’ is used to copy the needed support files from the NcDialog API directories:
NCurses.hpp // Definitions for the NCurses class
NCursesKeyDef.hpp // NcDialog API keycode definitions
gString.hpp // Definitions for gString text formatting utility
NcDialog.a // NcDialog API link library
Then G++ is invoked to build and link the binary executable file.
The application should build without errors and without warnings.
- Test the build:
The application version and a copyright message should be displayed.
TermSize (termsize) v:0.0.01 - 2021-2022
License GPLv3+: GNU GPL version 3
This is free software: you are free to modify and/or redistribute it
under the terms set out in the license.
There is NO WARRANTY, to the extent permitted by law.
For invocation options, type:
See the next section for a description of command-line options.
Make the application visible on the system $PATH:
This can be done in either of two ways:
1) copy the executable to a directory on the path:
cp --preserve=all ./termsize ~/bin/.
2) create a symbolic link to the executable in the source directory.
cp --symbolic-link ./termsize ~/bin/.
User Interface and command-line options.
The TermSize application's user interface is simple: It monitors keyboard and mouse input.
When a “terminal resize” signal is received, the display is updated to reflect the new terminal dimensions.
For any other keyboard or mouse event, the application will immediately exit to the command prompt.
Note for novice users: To resize the terminal window, use the mouse to left-click and hold any point along the border of
the window, drag the window to the desired size and release. Double-click on the window title bar to switch between
full-screen mode and window mode.
Invocation: termsize [OPTIONS] (all options are optional)
- –c Center the report in the terminal window.
(default is to place report in upper left corner of window)
Select foreground and background text color attributes for the display.
Foreground and background (if specified) may each be one of the following:
“black”, “red”, “green”, “brown”, “blue”, “magenta”, “cyan”, “grey”
or “reverse” to indicate reversed foreground/background.
For foreground only, “term” specifies use of default terminal colors.
Default Color Scheme: green foreground on black background.
--color=brown (brown text on terminal background)
--color=cyan,magenta (cyan text on magenta)
--color=blue,reverse (terminal background on blue)
--color=term (terminal foreground/background colors)
--color=reverse (terminal colors with fg/bg reversed)
--color=term,reverse (terminal colors with fg/bg reversed)
Note: The first four(4) characters of the color attribute are required.
- ––help or –h Display application help, then exit.
- ––version or –v Display application version and copyright information.
Notes on the current release of “TermSize”
The files included in this release.
TermSize/ // Source code directory
TermSize.cpp // Application source code
GlobalDef.hpp // Specifies '#include' files and general definitions
Makefile // Build the 'termsize' application
README // Package description, release notes
Note: The change log is located in the header of “TermSize.cpp”.
These notes are adapted from the “README” file included with the application archive.
Thank you, and we hope you enjoy using this application! — Software Sam