A simple command-line tool that retains the main feature of the linux watch
command and supports scrollable output.
watching
adds the following features to make the watch
command more user-friendly for certain use cases:
Useful for situations where the output of the command cannot fit into the entire terminal window.
The default behavior of watch
in such cases is to keep only the characters that will fit into the screen
while discarding the rest, which isn't ideal for all cases. watching
circumvents that by retaining all
characters of the output of the command and allowing you to scroll through them.
demo_scrolling.mp4
Vim-style scrolling is supported: to scroll down, press j
; to scroll up, press k
IMPORTANT:
Please note that watching
is not meant to replace the linux watch
command.
As such, not all features and flags of the watch
command is implemented. For example,
watching
does not support the ability to take screenshots. For those use cases, it makes
more sense to use the watch
command. watching
is useful for a specific use case only:
when you need to scroll through the command output you're watching.
Clone this repository and run the setup script.
Python 3.60+
watching [{-n | --interval} <time_seconds>] [{-h | --help}] [{-w | --no-wrap}] [{-t | --no-title}] <cmd> [args]
-
-n
,--interval
The watch interval. Takes precedence over the
WATCH_INTERVAL
environment variable. -
-w
,--no-wrap
Turn off line wrapping. Long lines will be truncated instead of wrapped to the next line.
-
-t
,--no-title
Turn off the heading normally shown at the top of the screen.
j
to scroll downk
to scroll upq
to quit
The behavior of watching
is affected by the following environment variables:
-
WATCH_INTERVAL
Update interval, follows the same rules as the
--interval
command line option