New Upstream Snapshot - cmatrix

Ready changes

Summary

Merged new upstream version: 2.0+git20221105.1.d86b2a0 (was: 2.0).

Diff

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index bd16c7b..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,31 +0,0 @@
-/build
-config.h
-Makefile
-Makefile.in
-stamp-h
-stamp-h[0-9]*
-config.cache
-config.*
-compile
-configure
-configure.lineno
-cmatrix.spec
-depcomp
-install-sh
-missing
-aclocal.m4
-autom4te.cache/
-.deps
-*.tab.c
-TAGS
-ID
-GTAGS GRTAGS GSYMS GPATH tags
-cscope.out
-cscope.in.out
-cscope.po.out
-cscope.files
-cmatrix
-*.o
-*.core
-CMakeCache.txt
-CMakeFiles/
diff --git a/.travis.yml b/.travis.yml
index dd1cc30..0abc5f0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,6 @@
+arch:
+  - amd64
+  - ppc64le
 language: c
 
 os:
@@ -24,4 +27,3 @@ script:
         mkdir build && cd build && cmake -DCMAKE_C_COMPILER="${CC}" ..
       fi
   - make
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5548b3..6e672b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 2.8)
 project(CMatrix LANGUAGES C)
 set(VERSION "2.0")
 
+include(GNUInstallDirs)
+
 # These are relative to CMAKE_INSTALL_PREFIX
 # which by default is "/usr/local"
 set(CONSOLE_FONTS_DIRS "share/consolefonts" "lib/kbd/consolefonts")
@@ -12,9 +14,20 @@ set(X_FONTS_DIRS "lib/X11/fonts/misc" "X11R6/lib/X11/fonts/misc" "share/fonts/X1
 
 set(MKFONTDIR "/usr/bin/mkfontdir")
 
-add_definitions(-DEXCLUDE_CONFIG_H)
+message(STATUS "Looking for include file config.h")
+if(NOT EXISTS "${CMAKE_SOURCE_DIR}/config.h")
+    add_definitions(-DEXCLUDE_CONFIG_H)
+    message(STATUS "Looking for include file config.h - missing")
+else()
+    message(STATUS "Looking for include file config.h - found")
+endif()
+
+# configure_file(config.h.in config.h)
+
 add_definitions(-DVERSION="${VERSION}")
-add_definitions(-DUSE_TIOCSTI)
+if	(NOT WIN32)
+	add_definitions(-DUSE_TIOCSTI)
+endif	()
 
 include(CheckIncludeFiles)
 check_include_files("sys/ioctl.h" HAVE_SYS_IOCTL_H)
@@ -33,8 +46,13 @@ check_include_files("termio.h" HAVE_TERMIO_H)
 if	(HAVE_TERMIO_H)
 	add_definitions(-DHAVE_TERMIO_H)
 endif	()
+check_include_files("getopt.h" HAVE_GETOPT_H)
+if	(HAVE_GETOPT_H)
+	add_definitions(-DHAVE_GETOPT_H)
+endif	()
 
 Set(CURSES_NEED_NCURSES TRUE)
+Set(CURSES_NEED_WIDE TRUE)
 find_package(Curses)
 include_directories(${CURSES_INCLUDE_DIR})
 add_definitions(-DHAVE_NCURSES_H)
@@ -43,7 +61,8 @@ add_executable(cmatrix cmatrix.c)
 
 target_link_libraries(cmatrix ${CURSES_LIBRARIES})
 
-install(TARGETS cmatrix DESTINATION bin)
+install(TARGETS cmatrix DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES cmatrix.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 if     (UNIX)
 	foreach    (CONSOLE_FONTS_DIR ${CONSOLE_FONTS_DIRS})
@@ -70,4 +89,3 @@ if     (UNIX)
 		endif  ()
 	endforeach ()
 endif  ()
-
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9d5c4cd..623bcba 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,19 +1,19 @@
 # Contributing
 
 When contributing to this repository, please first discuss the change you wish to make via issue,
-email, or any other method with the owners of this repository before making a change. 
+email, or any other method with the owners of this repository before making a change.
 
 Please note we have a code of conduct, please follow it in all your interactions with the project.
 
 ## Pull Request Process
 
-1. Ensure any install or build dependencies are removed before the end of the layer when doing a 
+1. Ensure any install or build dependencies are removed before the end of the layer when doing a
    build.
-2. Update the README.md with details of changes to the interface, this includes new environment 
+2. Update the README.md with details of changes to the interface, this includes new environment
    variables, exposed ports, useful file locations and container parameters.
 3. Increase the version numbers in any examples files and the README.md to the new version that this
    Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
-4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you 
+4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
    do not have permission to do that, you may request the second reviewer to merge it for you.
 
 ## Code of Conduct
diff --git a/COPYING b/COPYING
index 94a9ed0..f288702 100644
--- a/COPYING
+++ b/COPYING
@@ -1,7 +1,7 @@
                     GNU GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
   You should also get your employer (if you work as a programmer) or school,
 if any, to sign a "copyright disclaimer" for the program, if necessary.
 For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
+<https://www.gnu.org/licenses/>.
 
   The GNU General Public License does not permit incorporating your program
 into proprietary programs.  If your program is a subroutine library, you
 may consider it more useful to permit linking proprietary applications with
 the library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 3934370..27aeb8d 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -3,7 +3,7 @@ I am submitting a <!-- Feature Request / Bug Report -->
 ### Problem or Feature in Brief
 <!--- Explain the problem in detail here -->
 
-### 
+###
 
 ### Solution (if any)
 <!-- If you would like to offer any solutions, provide it here or leave this section
diff --git a/Makefile.am b/Makefile.am
index 60dc25a..be482b4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,29 +17,38 @@ install-data-local:
 	@if test $(BUILD_FONTS) = 1; then \
 		if test -d /usr/share/consolefonts; then \
 	    		echo " Installing matrix fonts in /usr/share/consolefonts..."; \
-	    		$(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/share/consolefonts; \
-	    		$(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/share/consolefonts; \
+	    		mkdir -p $(DESTDIR)/usr/share/consolefonts; \
+	    		$(INSTALL_DATA) $(srcdir)/matrix.fnt $(DESTDIR)/usr/share/consolefonts; \
+	    		$(INSTALL_DATA) $(srcdir)/matrix.psf.gz $(DESTDIR)/usr/share/consolefonts; \
 		fi; \
 		if test -d /usr/lib/kbd/consolefonts; then \
 	    		echo " Installing matrix fonts in /usr/lib/kbd/consolefonts..."; \
-	    		$(INSTALL_DATA) $(srcdir)/matrix.fnt /usr/lib/kbd/consolefonts; \
-	    		$(INSTALL_DATA) $(srcdir)/matrix.psf.gz /usr/lib/kbd/consolefonts; \
+	    		$(INSTALL_DATA) $(srcdir)/matrix.fnt $(DESTDIR)/usr/lib/kbd/consolefonts; \
+	    		$(INSTALL_DATA) $(srcdir)/matrix.psf.gz $(DESTDIR)/usr/lib/kbd/consolefonts; \
 		fi; \
-		if test -d /usr/lib/X11/fonts/misc; then \
-	    		echo " Installing X window matrix fonts in /usr/lib/X11/fonts/misc..."; \
-	    		$(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \
-	    		$(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/lib/X11/fonts/misc; \
-	    		echo " Running mkfontdir /usr/lib/X11/fonts/misc..."; \
-	    		$(MKFONTDIR) /usr/lib/X11/fonts/misc; \
+		if test -d /usr/share/fonts/misc; then \
+	    		echo " Installing X window matrix fonts in /usr/share/fonts/misc..."; \
+	    		echo " Running mkfontdir /usr/share/fonts/misc..."; \
+	    		$(MKFONTDIR) $(DESTDIR)/usr/share/fonts/misc; \
+	    		$(INSTALL_DATA) $(srcdir)/mtx.pcf $(DESTDIR)/usr/share/fonts/misc; \
+	    		$(INSTALL_DATA) $(srcdir)/mtx.pcf $(DESTDIR)/usr/share/fonts/misc; \
+	    		echo " Done.  If this is the first time you have installed CMatrix you will"; \
+	    		echo " probably have to restart X window in order to use the mtx.pcf font."; \
+		elif test -d /usr/share/X11/fonts/misc; then \
+	    		echo " Installing X window matrix fonts in /usr/share/X11/fonts/misc..."; \
+	    		echo " Running mkfontdir /usr/share/X11/fonts/misc..."; \
+	    		$(MKFONTDIR) $(DESTDIR)/usr/share/X11/fonts/misc; \
+	    		$(INSTALL_DATA) $(srcdir)/mtx.pcf $(DESTDIR)/usr/share/X11/fonts/misc; \
+	    		$(INSTALL_DATA) $(srcdir)/mtx.pcf $(DESTDIR)/usr/share/X11/fonts/misc; \
 	    		echo " Done.  If this is the first time you have installed CMatrix you will"; \
 	    		echo " probably have to restart X window in order to use the mtx.pcf font."; \
 		else \
 			if test -d /usr/X11R6/lib/X11/fonts/misc; then \
 	    			echo " Installing X window matrix fonts in /usr/X11R6/lib/X11/fonts/misc..."; \
-	    			$(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \
-	    			$(INSTALL_DATA) $(srcdir)/mtx.pcf /usr/X11R6/lib/X11/fonts/misc; \
 	    			echo " Running mkfontdir /usr/X11R6/lib/X11/fonts/misc..."; \
-	    			$(MKFONTDIR) /usr/X11R6/lib/X11/fonts/misc; \
+	    			$(MKFONTDIR) $(DESTDIR)/usr/X11R6/lib/X11/fonts/misc; \
+	    			$(INSTALL_DATA) $(srcdir)/mtx.pcf $(DESTDIR)/usr/X11R6/lib/X11/fonts/misc; \
+	    			$(INSTALL_DATA) $(srcdir)/mtx.pcf $(DESTDIR)/usr/X11R6/lib/X11/fonts/misc; \
 	    			echo " Done.  If this is the first time you have installed CMatrix you will"; \
 	    			echo " probably have to restart X window in order to use the mtx.pcf font."; \
 			fi \
@@ -47,4 +56,3 @@ install-data-local:
 	else \
 		echo "Not installing matrix fonts"; \
 	fi
-
diff --git a/README.md b/README.md
index df9d426..0e43ab5 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,185 @@
-# CMatrix
+<h1 align="center">CMatrix</h1>
+
+<h3 align="center"> Matrix like effect in your terminal </h3>
+
+</p>
+<p align="center">
+  <a href="https://travis-ci.org/abishekvashok/cmatrix">
+    <img src="https://travis-ci.org/abishekvashok/cmatrix.svg?branch=master">
+  </a>
+  <a href="./COPYING">
+    <img src="https://img.shields.io/github/license/abishekvashok/cmatrix?color=blue">
+  </a>
+  <img src="https://img.shields.io/badge/contributions-welcome-orange">
+  <a href="https://github.com/abishekvashok/cmatrix/stargazers">
+    <img src="https://img.shields.io/github/stars/abishekvashok/cmatrix">
+  </a>
+  <a href="https://github.com/abishekvashok/cmatrix/network">
+    <img src="https://img.shields.io/github/forks/abishekvashok/cmatrix">
+  </a>
+</p>
+
+
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
+
+## Contents
+- [Overview](#overview)
+- [Build Dependencies](#build-dependencies)
+- [Building and Installation](#building-and-installing-cmatrix)
+    - [Using configure (recommended)](#using-configure-(recommended-for-most-linux%2Fmingw-users))
+    - [Using CMake](#using-cmake)
+- [Usage](#usage)
+- [Captures](#captures)
+    - [Screenshots](#screenshots)
+    - [Screencasts](#screencasts)
+- [Maintainer](#maintainers)
+    - [Contributors](#our-contributors)
+- [Contribution Guide](#contribution-guide)
+- [License](#license)
+
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
+
+## :cloud: Overview
 
 CMatrix is based on the screensaver from The Matrix website. It shows text
 flying in and out in a terminal like as seen in "The Matrix" movie. It can
 scroll lines all at the same rate or asynchronously and at a user-defined
 speed.
 
-CMatrix by default operates in **eye candy** mode.  It must be aborted with
-control-c (Ctrl+C) or by pressing q.  If you wish for more of a screen saver
-effect, you must specify `-s` on the command line. For usage info, use `cmatrix -h`.
+CMAtrix is inspired from 'The Matrix' movie. If you haven’t seen this movie and you are a fan of computers or sci-fi in general, go see this movie!!!
 
-[![Build Status](https://travis-ci.org/abishekvashok/cmatrix.svg?branch=master)](https://travis-ci.org/abishekvashok/cmatrix)
-
-### Dependencies
-You'll probably need a decent ncurses library to get this to work.
+> :grey_exclamation:`Disclaimer` : We are in no way affiliated in any way with the movie "The Matrix", "Warner Bros" nor
+any of its affiliates in any way, just fans.
 
-### Building and installing cmatrix
-To install cmatrix, use either of the following methods from within the cmatrix directory.
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
 
-#### Using `configure` (recommended for most linux user)
+## :open_file_folder: Build Dependencies
+You'll probably need a decent ncurses library to get this to work. On Windows, using mingw-w64-ncurses is recommended (PDCurses will also work, but it does not support colors or bold text).
+<br>
+##### :small_blue_diamond: For Linux<br>
+Run this command to check the version of ncurses.
+```
+ldconfig -p | grep ncurses
 ```
+If you get no output then you need to install ncurses. Click below to install ncurses in Linux.
+- [ncurses](https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/)
+
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
+
+## :floppy_disk: Building and installing cmatrix
+To install cmatrix, Clone this repo in your local system and use either of the following methods from within the cmatrix directory.
+
+#### :small_blue_diamond: Using `configure` (recommended for most linux/mingw users)
+```sh
 autoreconf -i  # skip if using released tarball
 ./configure
 make
 make install
 ```
 
-#### Using CMake
+#### :small_blue_diamond: Using CMake
 Here we also show an out-of-source build in the sub directory "build".
-```
+(Doesn't work on Windows, for now).
+```sh
 mkdir -p build
 cd build
 # to install to "/usr/local"
 cmake ..
-# or to install to "/usr"
+# OR 
+# to install to "/usr"
 #cmake -DCMAKE_INSTALL_PREFIX=/usr ..
 make
 make install
 ```
 
-### Running cmatrix
-After you have installed cmatrix just run `cmatrix` to run cmatrix :)
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
+
+## :bookmark_tabs: Usage
+
+After you have installed **cmatrix** just type the command `cmatrix` to run it :)
+```sh
+cmatrix
+```
+Run with different arguments to get different effects.
+```sh
+cmatrix [-abBflohnsmVx] [-u update] [-C color]
+```
+Example:
+```sh
+cmatrix -ba -u 2 -C red
+```
+
+For more options and **help** run `cmatrix -h` <br>OR<br> Read Manual Page by running command `man cmatrix`
 
 _To get the program to look most like the movie, use `cmatrix -lba`_
 _To get the program to look most like the Win/Mac screensaver, use `cmatrix -ol`_
 
-### Valuable information
-If you have any suggestions/flames/patches to send, please feel free to
-open issues and if possible solve them in PRs via Github.
+> :round_pushpin: _Note: cmatrix is probably not particularly portable or efficient, but it wont hog
+**too** much CPU time._
+
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
 
-_Note: cmatrix is probably not particularly portable or efficient, but it wont hog
-**too** much CPU time_
+## :camera: Captures
 
-### Captures
+#### :small_blue_diamond: Screenshots
 
-#### Screenshots
+<!-- ![Special Font & bold](data/img/capture_bold_font.png?raw=true "cmatrix -bx") -->
+<p align="center">
+<img src="./data/img/capture_bold_font.png" alt="cmatrix screenshot">
+</p>
 
-![Special Font & bold](data/img/capture_bold_font.png?raw=true "cmatrix -bx")
+#### :small_blue_diamond: Screencasts
 
-#### Screencasts
+<!-- ![Movie-Like Cast](data/img/capture_orig.gif?raw=true "cmatrix -xba") -->
+<p align="center">
+<img src="./data/img/capture_orig.gif" alt="cmatrix screencast">
+</p>
 
-![Movie-Like Cast](data/img/capture_orig.gif?raw=true "cmatrix -xba")
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
 
-### Maintainers
-- Abishek V Ashok (@abishekvashok) <abishekvashok@gmail.com> [Core]
+## :zap: Maintainers
+- ➤ **Abishek V Ashok** [Core] - <abishekvashok@gmail.com><br> 
+<p align="center">
+  <a href="https://twitter.com/abishekvashok">
+    <img src="https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white">
+  </a>
+  <a href="https://github.com/abishekvashok">
+    <img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white">
+  </a>
+</p>
 
-### Thanks to:
-- Chris Allegretta <chrisa@asty.org> for writing cmatrix up in a fornight and giving us
+
+## :busts_in_silhouette: Our Contributors
+#### :small_orange_diamond: Thanks to:
+- ➤ **Chris Allegretta** <chrisa@asty.org> for writing cmatrix up in a fortnight and giving us
   the responsibility to further improve it.
-- Krisjon Hanson and Bjoern Ganslandt for helping with bold support and 
+- ➤ **Krisjon Hanson** and **Bjoern Ganslandt** for helping with bold support and
   Bjoern again for the cursor removal code, helping with the `-u` and `-l`
   modes/flags, and Makefile improvements.
-- Adam Gurno for multi-color support.
-- Garrick West for debian consolefont dir support.
-- Nemo for design thoughts and continuous help and support.
-- John Donahue for helping with transparent term support
-- Ben Esacove for Redhat 6 compatibility w/matrix.psf.gz
-- jwz for the xmatrix module to xscreensaver at http://www.jwz.org/xscreensaver.
-- Chris Allegretta's girlfriend Amy for not killing him when he stayed up till 3 AM
+- ➤ **Adam Gurno** for multi-color support.
+- ➤ **Garrick West** for debian consolefont dir support.
+- ➤ **Nemo** for design thoughts and continuous help and support.
+- ➤ **John Donahue** for helping with transparent term support
+- ➤ **Ben Esacove** for Redhat 6 compatibility w/matrix.psf.gz
+- ➤ **jwz** for the xmatrix module to xscreensaver at http://www.jwz.org/xscreensaver.
+- Chris Allegretta's girlfriend **Amy** for not killing him when he stayed up till 3 AM
   writing code.
+- ➤ **Sumit Kumar Soni** for beautifying the README.
 - The makers of the Matrix for one kickass movie!
-- Everyone who has sent (and who will send) us and Chris mails regarding
-  bugs, comments, patches or just a hello.
-- Everyone who has opened issues and PRs on the github repository.
+- ➤ Everyone who has sent (and who will send) us and Chris mails regarding
+  bugs, comments, patches or just a simple hello.
+- ➤ Everyone who has contributed to the project by opening issues and PRs on the github repository.
 
-### License
-This software is provided under the GNU GPL v3.
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
 
-### Disclaimer
-We are in no way affiliated in any way with the movie "The Matrix", "Warner Bros" nor
-any of its affiliates in any way, just fans.
+## :book: Contribution Guide
+If you have any suggestions/flames/patches to send, please feel free to
+- Open issues and if possible label them, so that it is easy to categorise features, bugs etc.
+- If you solved some problems or made some valuable changes, Please open a Pull Request on Github.
+- See [contributing.md](./CONTRIBUTING.md) for more details.
+
+![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
+
+## :page_facing_up: License
+This software is provided under the GNU GPL v3. [View License](./COPYING)
 
diff --git a/cmatrix.1 b/cmatrix.1
index 2dbf23e..59c6654 100644
--- a/cmatrix.1
+++ b/cmatrix.1
@@ -26,9 +26,21 @@ Linux mode (sets "matrix.fnt" font in console)
 .I "\-o"
 Use old-style scrolling
 .TP
+.I "\-c"
+Only print the shadows of letters 
+.TP
+.I "\-L"
+Locks cmatrix, Unable to quit
+.TP
 .I "\-h, \-?"
 Print usage and exit
 .TP
+.I "\-r"
+"Rainbow" mode, rainbow colored character
+.TP
+.I "\-k"
+Every characters change 
+.TP
 .I "\-n"
 No bold characters (overrides \-b and \-B)
 .TP
@@ -48,8 +60,14 @@ Print version information and exit
 Screen update delay 0 - 9, default 4
 .TP
 .I "\-C color"
-Use this color for matrix (default green). 
+Use this color for matrix (default green).
 Valid colors are green, red, blue, white, yellow, cyan, magenta and black.
+.TP
+.I "\-M message"
+Add a message in the center of cmatrix
+.TP
+.I "\-t tty"
+Set tty to use
 .SS KEYSTROKES
 The following keystrokes are available during execution (unavailable in
 \-s mode)
diff --git a/cmatrix.c b/cmatrix.c
index 90284cb..7d8ca39 100644
--- a/cmatrix.c
+++ b/cmatrix.c
@@ -17,10 +17,13 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+    along with cmatrix. If not, see <http://www.gnu.org/licenses/>.
 
 */
 
+#define NCURSES_WIDECHAR 1
+
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -29,19 +32,30 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <termios.h>
 #include <signal.h>
 #include <locale.h>
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
 
 #ifndef EXCLUDE_CONFIG_H
 #include "config.h"
 #endif
 
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
 #ifdef HAVE_NCURSES_H
 #include <ncurses.h>
 #else
+#ifdef _WIN32
+#include <ncurses/curses.h>
+#else
 #include <curses.h>
 #endif
+#endif
 
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
@@ -57,6 +71,10 @@
 #include <termio.h>
 #endif
 
+#ifdef __CYGWIN__
+#define TIOCSTI 0x5412
+#endif
+
 /* Matrix typedef */
 typedef struct cmatrix {
     int val;
@@ -71,7 +89,9 @@ cmatrix **matrix = (cmatrix **) NULL;
 int *length = NULL;  /* Length of cols in each line */
 int *spaces = NULL;  /* Spaces left to fill */
 int *updates = NULL; /* What does this do again? */
+#ifndef _WIN32
 volatile sig_atomic_t signal_status = 0; /* Indicates a caught signal */
+#endif
 
 int va_system(char *str, ...) {
 
@@ -127,7 +147,7 @@ void c_die(char *msg, ...) {
 }
 
 void usage(void) {
-    printf(" Usage: cmatrix -[abBcfhlsmVx] [-u delay] [-C color]\n");
+    printf(" Usage: cmatrix -[abBcfhlsmVxk] [-u delay] [-C color] [-t tty] [-M message]\n");
     printf(" -a: Asynchronous scroll\n");
     printf(" -b: Bold characters on\n");
     printf(" -B: All bold characters (overrides -b)\n");
@@ -141,10 +161,13 @@ void usage(void) {
     printf(" -s: \"Screensaver\" mode, exits on first keystroke\n");
     printf(" -x: X window mode, use if your xterm is using mtx.pcf\n");
     printf(" -V: Print version information and exit\n");
+    printf(" -M [message]: Prints your message in the center of the screen. Overrides -L's default message.\n");
     printf(" -u delay (0 - 10, default 4): Screen update delay\n");
     printf(" -C [color]: Use this color for matrix (default green)\n");
     printf(" -r: rainbow mode\n");
     printf(" -m: lambda mode\n");
+    printf(" -k: Characters change while scrolling. (Works without -o opt.)\n");
+    printf(" -t [tty]: Set tty to use\n");
 }
 
 void version(void) {
@@ -219,11 +242,22 @@ void var_init() {
 
 }
 
+#ifndef _WIN32
 void sighandler(int s) {
     signal_status = s;
 }
+#endif
 
 void resize_screen(void) {
+#ifdef _WIN32
+    BOOL result;
+    HANDLE hStdHandle;
+    CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+
+    hStdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
+    if (hStdHandle == INVALID_HANDLE_VALUE)
+        return;
+#else
     char *tty;
     int fd = 0;
     int result = 0;
@@ -232,6 +266,14 @@ void resize_screen(void) {
     tty = ttyname(0);
     if (!tty) {
         return;
+#endif
+#ifdef _WIN32
+    result = GetConsoleScreenBufferInfo(hStdHandle, &csbiInfo);
+    if (!result)
+        return;
+    LINES = csbiInfo.dwSize.Y;
+    COLS = csbiInfo.dwSize.X;
+#else
     }
     fd = open(tty, O_RDWR);
     if (fd == -1) {
@@ -244,11 +286,12 @@ void resize_screen(void) {
 
     COLS = win.ws_col;
     LINES = win.ws_row;
+#endif
 
-    if(LINES <10){
+    if (LINES < 10) {
         LINES = 10;
     }
-    if(COLS <10){
+    if (COLS < 10) {
         COLS = 10;
     }
 
@@ -287,13 +330,16 @@ int main(int argc, char *argv[]) {
     int randmin = 0;
     int pause = 0;
     int classic = 0;
+    int changes = 0;
+    char *msg = "";
+    char *tty = NULL;
 
     srand((unsigned) time(NULL));
     setlocale(LC_ALL, "");
 
     /* Many thanks to morph- (morph@jmss.com) for this getopt patch */
     opterr = 0;
-    while ((optchr = getopt(argc, argv, "abBcfhlLnrosmxVu:C:")) != EOF) {
+    while ((optchr = getopt(argc, argv, "abBcfhlLnrosmxkVM:u:C:t:")) != EOF) {
         switch (optchr) {
         case 's':
             screensaver = 1;
@@ -343,6 +389,13 @@ int main(int argc, char *argv[]) {
             break;
         case 'L':
             lock = 1;
+            //if -M was used earlier, don't override it
+            if (0 == strncmp(msg, "", 1)) {
+                msg = "Computer locked.";
+            }
+            break;
+        case 'M':
+            msg = strdup(optarg);
             break;
         case 'n':
             bold = -1;
@@ -364,30 +417,64 @@ int main(int argc, char *argv[]) {
             version();
             exit(0);
         case 'r':
-             rainbow = 1;
-             break;
+            rainbow = 1;
+            break;
         case 'm':
-             lambda = 1;
-             break;
+            lambda = 1;
+            break;
+        case 'k':
+            changes = 1;
+            break;
+        case 't':
+            tty = optarg;
+            break;
         }
     }
 
+    /* Clear TERM variable on Windows */
+#ifdef _WIN32
+    _putenv_s("TERM", "");
+#endif
+
     if (force && strcmp("linux", getenv("TERM"))) {
+#ifdef _WIN32
+        SetEnvironmentVariableW(L"TERM", L"linux");
+#else
         /* setenv is much more safe to use than putenv */
         setenv("TERM", "linux", 1);
+#endif
     }
-    initscr();
+    if (tty) {
+        FILE *ftty = fopen(tty, "r+");
+        if (!ftty) {
+            fprintf(stderr, "cmatrix: error: '%s' couldn't be opened: %s.\n",
+                    tty, strerror(errno));
+            exit(EXIT_FAILURE);
+        }
+        SCREEN *ttyscr;
+        ttyscr = newterm(NULL, ftty, ftty);
+        if (ttyscr == NULL)
+            exit(EXIT_FAILURE);
+        set_term(ttyscr);
+    } else
+        initscr();
     savetty();
     nonl();
+#ifdef _WIN32
+    raw();
+#else
     cbreak();
+#endif
     noecho();
     timeout(0);
     leaveok(stdscr, TRUE);
     curs_set(0);
+#ifndef _WIN32
     signal(SIGINT, sighandler);
     signal(SIGQUIT, sighandler);
     signal(SIGWINCH, sighandler);
     signal(SIGTSTP, sighandler);
+#endif
 
 if (console) {
 #ifdef HAVE_CONSOLECHARS
@@ -421,7 +508,7 @@ if (console) {
             init_pair(COLOR_YELLOW, COLOR_YELLOW, -1);
         } else {
 #else
-        { /* Hack to deal the after effects of else in HAVE_USE_DEFAULT_COLOURS*/
+        { /* Hack to deal the after effects of else in HAVE_USE_DEFAULT_COLOURS */
 #endif
             init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
             init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
@@ -435,10 +522,13 @@ if (console) {
     }
 
     /* Set up values for random number generation */
-    if(classic) {
-        /* Japanese character unicode range [they are seen in the original cmatrix] */
-        randmin = 12288;
-        highnum = 12351;
+    if (classic) {
+        /* Half-width kana characters. In the movie they are y-axis flipped, and
+         * they appear alongside latin characters and numerals, but this is the
+         * closest we can do with a standard unicode set and a single number
+         * range */
+        randmin = 0xff66;
+        highnum = 0xff9d;
     } else if (console || xwindow) {
         randmin = 166;
         highnum = 217;
@@ -451,9 +541,10 @@ if (console) {
     var_init();
 
     while (1) {
+#ifndef _WIN32
         /* Check for signals */
         if (signal_status == SIGINT || signal_status == SIGQUIT) {
-            if(lock != 1)
+            if (lock != 1)
                 finish();
             /* exits */
         }
@@ -462,10 +553,11 @@ if (console) {
             signal_status = 0;
         }
 
-        if(signal_status == SIGTSTP){
-            if(lock != 1)
+        if (signal_status == SIGTSTP) {
+            if (lock != 1)
                     finish();
         }
+#endif
 
         count++;
         if (count > 4) {
@@ -489,8 +581,11 @@ if (console) {
                 finish();
             } else {
                 switch (keypress) {
+#ifdef _WIN32
+                case 3: /* Ctrl-C. Fall through */
+#endif
                 case 'q':
-                    if(lock != 1)
+                    if (lock != 1)
                         finish();
                     break;
                 case 'a':
@@ -565,7 +660,7 @@ if (console) {
         for (j = 0; j <= COLS - 1; j += 2) {
             if ((count > updates[j] || asynch == 0) && pause == 0) {
 
-                /* I dont like old-style scrolling, yuck */
+                /* I don't like old-style scrolling, yuck */
                 if (oldstyle) {
                     for (i = LINES - 1; i >= 1; i--) {
                         matrix[i][j].val = matrix[i - 1][j].val;
@@ -581,7 +676,7 @@ if (console) {
                             spaces[j]--;
                         } else {
 
-                            /* Random number to determine whether head of next collumn
+                            /* Random number to determine whether head of next column
                                of chars has a white 'head' on it. */
 
                             if (((int) rand() % 3) == 1) {
@@ -600,7 +695,6 @@ if (console) {
                 } else { /* New style scrolling (default) */
                     if (matrix[0][j].val == -1 && matrix[1][j].val == ' '
                         && spaces[j] > 0) {
-                        matrix[0][j].val = -1;
                         spaces[j]--;
                     } else if (matrix[0][j].val == -1
                         && matrix[1][j].val == ' ') {
@@ -624,12 +718,16 @@ if (console) {
                             break;
                         }
 
-                        /* Go to the head of this collumn */
+                        /* Go to the head of this column */
                         z = i;
                         y = 0;
                         while (i <= LINES && (matrix[i][j].val != ' ' &&
                                matrix[i][j].val != -1)) {
                             matrix[i][j].is_head = false;
+                            if (changes) {
+                                if (rand() % 8 == 0)
+                                    matrix[i][j].val = (int) rand() % randnum + randmin;
+                            }
                             i++;
                             y++;
                         }
@@ -642,7 +740,7 @@ if (console) {
                         matrix[i][j].val = (int) rand() % randnum + randmin;
                         matrix[i][j].is_head = true;
 
-                        /* If we're at the top of the collumn and it's reached its
+                        /* If we're at the top of the column and it's reached its
                            full length (about to start moving down), we do this
                            to get it moving.  This is also how we keep segments not
                            already growing from growing accidentally =>
@@ -667,7 +765,7 @@ if (console) {
             for (i = y; i <= z; i++) {
                 move(i - y, j);
 
-                if (matrix[i][j].is_head && !rainbow) {
+                if (matrix[i][j].val == 0 || (matrix[i][j].is_head && !rainbow)) {
                     if (console || xwindow) {
                         attron(A_ALTCHARSET);
                     }
@@ -681,6 +779,8 @@ if (console) {
                         } else {
                             addch('&');
                         }
+                    } else if (matrix[i][j].val == -1) {
+                        addch(' ');
                     } else {
                         addch(matrix[i][j].val);
                     }
@@ -693,10 +793,10 @@ if (console) {
                         attroff(A_ALTCHARSET);
                     }
                 } else {
-                    if(rainbow) {
+                    if (rainbow) {
                         int randomColor = rand() % 6;
 
-                        switch(randomColor){
+                        switch (randomColor) {
                             case 0:
                                 mcolor = COLOR_GREEN;
                                 break;
@@ -739,7 +839,15 @@ if (console) {
                         } else if (lambda && matrix[i][j].val != ' ') {
                             addstr("λ");
                         } else {
-                            addch(matrix[i][j].val);
+                            /* addch doesn't seem to work with unicode
+                             * characters and there was no direct equivalent.
+                             * So, construct a c-style string with the character
+                             * and print that.
+                             */
+                            wchar_t char_array[2];
+                            char_array[0] = matrix[i][j].val;
+                            char_array[1] = 0;
+                            addwstr(char_array);
                         }
                         if (bold == 2 ||
                             (bold == 1 && matrix[i][j].val % 2 == 0)) {
@@ -754,18 +862,16 @@ if (console) {
             }
         }
 
-        //Check if computer is locked
-        if(lock == 1){
-
+        //check if -M and/or -L was used
+        if (msg[0] != '\0') {
             //Add our message to the screen
-            char *msg = "Computer locked.";
             int msg_x = LINES/2;
             int msg_y = COLS/2 - strlen(msg)/2;
             int i = 0;
 
             //Add space before message
             move(msg_x-1, msg_y-2);
-            for(i = 0; i < strlen(msg)+4; i++)
+            for (i = 0; i < strlen(msg)+4; i++)
                 addch(' ');
 
             //Write message
@@ -778,7 +884,7 @@ if (console) {
 
             //Add space after message
             move(msg_x+1, msg_y-2);
-            for(i = 0; i < strlen(msg)+4; i++)
+            for (i = 0; i < strlen(msg)+4; i++)
                 addch(' ');
         }
 
@@ -786,4 +892,3 @@ if (console) {
     }
     finish();
 }
-
diff --git a/configure.ac b/configure.ac
index 8a8066a..0565a52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,15 @@ AC_CONFIG_SRCDIR([cmatrix.c])
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE
 
+AC_CANONICAL_HOST
+case $host in
+  *mingw*)
+    ;;
+  *)
+    native_windows=no
+    ;;
+esac
+
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
@@ -16,7 +25,7 @@ AC_CHECK_LIB(ncurses, main)
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h termios.h termio.h)
+AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h termios.h termio.h getopt.h)
 
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
@@ -33,6 +42,11 @@ then
     AC_CHECK_LIB(curses, tgetent, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses)
 fi
 
+if eval "test x$CURSES_LIB_NAME = x"
+then
+    AC_CHECK_LIB(pdcurses, initscr, CURSES_LIB="-lpdcurses" CURSES_LIB_NAME=pdcurses)
+fi
+
 if eval "test x$CURSES_LIB_NAME = x"
 then
     AC_CHECK_LIB(termcap, tgetent, CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap)
@@ -48,7 +62,7 @@ then
     AC_MSG_WARN([
 *** No termcap lib available, consider getting the official ncurses
 *** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
-*** errors compiling nano.])
+*** errors compiling cmatrix.])
 else
     AC_MSG_RESULT("Using $CURSES_LIB_NAME as the termcap library")
 fi
@@ -59,13 +73,21 @@ AC_CHECK_LIB($CURSES_LIB_NAME, resizeterm, [AC_DEFINE(HAVE_RESIZETERM)])
 AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)])
 
 
-dnl Only change gcc options if we are using gcc.  
+dnl Only change gcc options if we are using gcc.
 if test "$ac_cv_prog_CC" = gcc -o "$ac_cv_prog_CC" = g++; then
   CFLAGS="$CFLAGS -Wall -Wno-comment"
 fi
 
+dnl Build static executable on native Windows
+if test x$native_windows != xno; then
+  CFLAGS="$CFLAGS -static"
+fi
+
 dnl cmatrix terminal font disable option (default enabled)
-AC_ARG_WITH([fonts], AS_HELP_STRING([--without-fonts], [Install cmatrix without cmatrix font]), [enable_fonts=false], [enable_fonts=true])
+AC_ARG_WITH([fonts],
+	AS_HELP_STRING([--without-fonts], [Install cmatrix without cmatrix font]),
+	AS_IF([test "x$with_fonts" == "xno"], [enable_fonts=false], [enable_fonts=true]),
+	[enable_fonts=true])
 
 if test "x$enable_fonts" != xfalse; then
   dnl Check for consolechars and setfonts
@@ -81,7 +103,7 @@ if test "x$enable_fonts" != xfalse; then
 *** console without this program (it may still work in xterms). If you are
 *** using Linux, the package containing this program is usually called
 *** kbd, kbd-utils, or console-utils
-])	
+])
       else
 	  AC_DEFINE_UNQUOTED(HAVE_SETFONT, $SETFONT)
       fi
@@ -97,7 +119,7 @@ if test "x$enable_fonts" != xfalse; then
 
 	  if test "x$ac_cv_file__usr_lib_kbd_consolefonts" = "xno"; then
 	      if test "x$ac_cv_file__usr_share_consolefonts" = "xno"; then
-		  AC_MSG_WARN([ 
+		  AC_MSG_WARN([
 
 *** You do not appear to have a consolefonts directory in a standard location
 *** (/usr/lib/kbd or /usr/share), even though you appear to have the
@@ -112,14 +134,14 @@ if test "x$enable_fonts" != xfalse; then
   fi
 
   AC_PATH_PROG(MKFONTDIR, mkfontdir, "", $PATH:/usr/bin:/usr/bin/X11:/usr/local/bin/X11:/usr/X11R6/bin:/usr/local/bin:/sbin:/usr/sbin)
-  AC_CHECK_FILES([/usr/lib/X11/fonts/misc /usr/X11R6/lib/X11/fonts/misc])
+  AC_CHECK_FILES([/usr/share/fonts/misc /usr/share/X11/fonts/misc /usr/X11R6/lib/X11/fonts/misc])
 
   if test "x$ac_cv_file__usr_lib_X11_fonts_misc" = "xno"; then
       if test "x$ac_cv_file__usr_X11R6_lib_X11_fonts_misc" = "xno"; then
-	  AC_MSG_WARN([ 
+	  AC_MSG_WARN([
 
 *** You do not appear to have an X window fonts directory in the standard
-*** locations (/usr/lib/X11/fonts/misc or /usr/X11R6/lib/X11/fonts/misc). The
+*** locations (/usr/share/fonts/misc or /usr/X11R6/lib/X11/fonts/misc). The
 *** mtx.pcf font will not be installed.  This means you will probably not
 *** be able to use the mtx fonts in your x terminals, and hence be unable
 *** to use the -x command line switch.  Sorry about that...
@@ -136,7 +158,9 @@ AM_CONDITIONAL([MATRIX_FONTS], [test x$enable_fonts = xtrue])
 
 AC_SUBST(CURSES_LIB)
 
-AC_DEFINE(USE_TIOCSTI)
+if test x$native_windows = xno; then
+  AC_DEFINE(USE_TIOCSTI)
+fi
 
 AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS], [Define this if your curses library has use_default_colors, for cool transparency =-)])
 AH_TEMPLATE([HAVE_CONSOLECHARS], [Define this if you have the linux consolechars program])
diff --git a/debian/changelog b/debian/changelog
index fc14ade..4642963 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+cmatrix (2.0+git20221105.1.d86b2a0-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * Drop patch 0002-Fix-78.patch, present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 09 Feb 2023 10:09:11 -0000
+
 cmatrix (2.0-3) unstable; urgency=medium
 
   [ Debian Janitor ]
diff --git a/debian/patches/0001-cmatrix.1-Improvement-on-man-page.patch b/debian/patches/0001-cmatrix.1-Improvement-on-man-page.patch
index 14bb733..4321001 100644
--- a/debian/patches/0001-cmatrix.1-Improvement-on-man-page.patch
+++ b/debian/patches/0001-cmatrix.1-Improvement-on-man-page.patch
@@ -7,10 +7,10 @@ Last-Update: 2019-05-07
  cmatrix.1 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/cmatrix.1 b/cmatrix.1
-index 2dbf23e..ff081b8 100644
---- a/cmatrix.1
-+++ b/cmatrix.1
+Index: cmatrix.git/cmatrix.1
+===================================================================
+--- cmatrix.git.orig/cmatrix.1
++++ cmatrix.git/cmatrix.1
 @@ -1,6 +1,6 @@
  .TH CMatrix 1 "Mon May 3 1999"
  .SH NAME
diff --git a/debian/patches/0002-Fix-78.patch b/debian/patches/0002-Fix-78.patch
deleted file mode 100644
index 710afde..0000000
--- a/debian/patches/0002-Fix-78.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Andrey Abramov <st5pub@yandex.ru>
-Date: Wed, 27 Mar 2019 18:22:01 +0300
-Subject: Fix #78
-
-Signed-off-by: Andrey Abramov <st5pub@yandex.ru>
----
- cmatrix.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cmatrix.c b/cmatrix.c
-index 90284cb..ee13caf 100644
---- a/cmatrix.c
-+++ b/cmatrix.c
-@@ -667,7 +667,7 @@ if (console) {
-             for (i = y; i <= z; i++) {
-                 move(i - y, j);
- 
--                if (matrix[i][j].is_head && !rainbow) {
-+                if (matrix[i][j].val == 0 || (matrix[i][j].is_head && !rainbow)) {
-                     if (console || xwindow) {
-                         attron(A_ALTCHARSET);
-                     }
diff --git a/debian/patches/series b/debian/patches/series
index 6d459f2..0cdd8a8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 0001-cmatrix.1-Improvement-on-man-page.patch
-0002-Fix-78.patch
diff --git a/takeScreenshots b/takeScreenshots
index 5816607..c209090 100755
--- a/takeScreenshots
+++ b/takeScreenshots
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # Produces a bunch of `cmatrix` screenshots and screencasts.
 # This script requires X and the following:
 #apt-get install rxvt byzanz
@@ -11,18 +11,17 @@ TERM_EMULATOR_BASE="rxvt +sb"
 CAPTURES_DIR="data/img"
 
 # Function to take a single cmatrix screenshot (takes about 3.5s to execute)
-# or optionally, a screncast of choosable length.
-function captureCMatrix()
-{
+# or optionally, a screencast of choosable length.
+captureCMatrix() {
 	CAPTURE_FILE="$1"
 	CMATRIX_OPTIONS="$2"
 	# If 0 (default if no 3rd param is given),
 	# we make a screenshot instead of a screencast.
 	SCREENCAST_DURATION="${3:-0}"
 
-	if [ ${SCREENCAST_DURATION} -gt 0 ]
+	if [ "${SCREENCAST_DURATION}" -gt 0 ]
 	then
-		let KILL_DELAY="${SCREENCAST_DURATION} + 1"
+		KILL_DELAY="$((SCREENCAST_DURATION + 1))"
 		CAPTURE_FILE="${CAPTURE_FILE}.gif"
 	else
 		KILL_DELAY=3
@@ -31,7 +30,7 @@ function captureCMatrix()
 	WINDOW_TITLE="CMatrix capture ${CAPTURE_FILE}"
 
 	# NOTE the "-PIPE" prevents output of the "Terminated: ..." message
-	( cmdpid=$BASHPID; ( sleep ${KILL_DELAY}; kill -PIPE $cmdpid ) & exec ${TERM_EMULATOR_BASE} -name "${WINDOW_TITLE}" -title "${WINDOW_TITLE}" -e bash -c "
+	( cmdpid=$BASHPID; ( sleep "${KILL_DELAY}"; kill -PIPE "$cmdpid" ) & exec ${TERM_EMULATOR_BASE} -name "${WINDOW_TITLE}" -title "${WINDOW_TITLE}" -e bash -c "
 		if [ ${SCREENCAST_DURATION} -gt 0 ]
 		then
 			# Take screencast (animated GIF)
@@ -74,4 +73,3 @@ do
 	${CMD_CS} "${CAPTURE_FILE_BASE}bold_C_${color}" "-b -C ${color}"
 done
 ${CMD_CS} "${CAPTURE_FILE_BASE}bold_rainbow" "-b -r"
-

More details

Full run details

Historical runs