Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ANSI escape codes for manipulating the terminal - A Python port of sindresorhus's ansi-escapes Node.js module
ansiescapes
ANSI escape codes <http://www.termsys.demon.co.uk/vtansi.htm>
_ for manipulating the terminal - A Python port of sindresorhus <https://github.com/sindresorhus>
's ansi-escapes <https://github.com/sindresorhus/ansi-escapes>
Node.js module.
.. code-block:: bash
$ pip install ansiescapes
.. code-block:: python
import ansiescapes import sys
sys.stdout.write(ansiescapes.cursorUp(2) + ansiescapes.cursorLeft) #=> '\u001B[2A\u001B[1000D'
Set the absolute position of the cursor. x0
y0
is the top left of the screen.
Set the position of the cursor relative to its current position.
Move cursor up a specific amount of rows. Default is 1
.
Move cursor down a specific amount of rows. Default is 1
.
Move cursor forward a specific amount of rows. Default is 1
.
Move cursor backward a specific amount of rows. Default is 1
.
Move cursor to the left side.
Save cursor position.
Restore saved cursor position.
Get cursor position.
Move cursor to the next line.
Move cursor to the previous line.
Hide cursor.
Show cursor.
Erase from the current cursor position up the specified amount of rows.
Erase from the current cursor position to the end of the current line.
Erase from the current cursor position to the start of the current line.
Erase the entire current line.
Erase the screen from the current line down to the bottom of the screen.
Erase the screen from the current line up to the top of the screen.
Erase the screen and move the cursor the top left position.
Scroll display up one line.
Scroll display down one line.
Clear the terminal screen.
Output a beeping sound.
Display an image.
Currently only supported on iTerm2 >=3
See termimg <https://github.com/kodie/termimg>
_ for a higher-level module.
input
Type: `Buffer`
Buffer of an image. Usually read in with `open`.
Example:
.. code-block:: python
import ansiescapes
import sys
from codecs import open
with open('image.png', 'rb') as imageFile:
f = imageFile.read()
b = bytearray(f)
sys.stdout.write(ansiescapes.image(b))
options
width
height
Type: string
number
The width and height are given as a number followed by a unit, or the word "auto".
N
: N character cells.Npx
: N pixels.N%
: N percent of the session's width or height.auto
: The image's inherent size will be used to determine an appropriate dimension.preserveAspectRatio
Type: boolean
Default: true
Type: string
Default: os.getcwd()
Inform iTerm2 <https://www.iterm2.com/documentation-escape-codes.html>
_ of the current directory to help semantic history and enable Cmd-clicking relative paths <https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click>
_.
MIT. See the LICENSE file <LICENSE.md>
_ for more info.
FAQs
ANSI escape codes for manipulating the terminal - A Python port of sindresorhus's ansi-escapes Node.js module
We found that ansiescapes 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.