
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
pager
Advanced tools
Python module that pages output to the screen, reads keys and console dimensions without executing external utils.
It was meant to be included in standard library http://bugs.python.org/issue8408
| Author: anatoly techtonik techtonik@gmail.com | License: Public Domain (or MIT if a license is required)
::
python -m pager | pager.py (Windows only - see issue #7) pager.py < (Windows only)
python -m pager --test
3.3 (stable)
3.2 (broken on Linux)
2.2 (stable)
1.4 (stable)
..function:: page(content, [pagecallback=prompt])
Output content iterable, calling pagecallback function after each
page with page number as a parameter. pagecallback function may
return False to terminate pagination.
Default prompt() callback shows page number with 'Press any key to
continue . . . ' prompt, waits for keypress and aborts if 'q', ESC or
Ctrl-C are pressed.
..function:: echo(msg)
Print msg to the screen without linefeed and flush the output.
..function:: getwidth()
Return width of available window in characters. If detection fails, return value of standard width 80. Coordinate of the last character on a line is -1 from returned value.
..function:: getheight()
Return available window height in characters or 25 if detection fails. Coordinate of the last line is -1 from returned value.
..function:: getch()
Wait for keypress, return first char generated as a result.
Arrows and special keys generate sequence of chars. Use getchars
function to receive all chars generated or present in buffer.
..function:: getchars()
Wait for keypress. Return list of chars generated as a result. More than one char in result list is returned when arrows and special keys are pressed. Returned sequences differ between platforms, so use constants defined in this module to guess correct keys.
..function:: dumpkey(key)
Helper to convert result of getch (string) or getchars (list)
to hex string.
| Danny Yoo for getch()-like unbuffered character reading recipe | http://code.activestate.com/recipes/134892-getch-like-unbuffered/
| Calvin Spealman (@ironfroggy), issue #6
| Excellent tutorials for Win32 Console by Adrian Worley | http://www.adrianxw.dk/SoftwareSite/index.html | Console Reference on MSDN | http://msdn.microsoft.com/en-us/library/ms682087%28VS.85%29.aspx
| Public Domain Curses library maintained by William McBrine | http://pdcurses.sourceforge.net/
| Ioctl (input/output control) introduction from Wikipedia | http://en.wikipedia.org/wiki/Ioctl | Linux Programmer's Manual - ioctls for terminals and serial lines | http://www.kernel.org/doc/man-pages/online/pages/man4/tty_ioctl.4.html
FAQs
Terminal/console pager module in pure Python
We found that pager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.