You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

xterm-addon-fit

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xterm-addon-fit

An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables fitting the terminal's dimensions to a containing element. This addon requires xterm.js v4+.

0.8.0
latest
Source
npmnpm
Version published
Weekly downloads
240K
-16.63%
Maintainers
1
Weekly downloads
 
Created

What is xterm-addon-fit?

The xterm-addon-fit npm package is an addon for the xterm.js terminal emulator that allows the terminal to automatically resize to fit its container. This is particularly useful for creating responsive terminal interfaces in web applications.

What are xterm-addon-fit's main functionalities?

Automatic Terminal Resizing

This feature allows the terminal to automatically resize to fit its container. The code sample demonstrates how to initialize the xterm.js terminal, load the fit addon, and fit the terminal to its container. It also shows how to make the terminal responsive to window resize events.

const { Terminal } = require('xterm');
const { FitAddon } = require('xterm-addon-fit');

const terminal = new Terminal();
const fitAddon = new FitAddon();
terminal.loadAddon(fitAddon);

// Attach the terminal to a DOM element
terminal.open(document.getElementById('terminal-container'));

// Fit the terminal to the container
fitAddon.fit();

// Optionally, you can fit the terminal whenever the window is resized
window.addEventListener('resize', () => fitAddon.fit());

Other packages similar to xterm-addon-fit

Keywords

terminal

FAQs

Package last updated on 07 Sep 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.