Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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-beta.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
148K
decreased by-13.62%
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

FAQs

Package last updated on 19 Aug 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc