Script

Terminal Size ⚑

Shows the current terminal size (columns x rows) in the state bar.

Import this State Bar Item to WebSSH

JavaScript Content

1
2
3
4
5
6
7
(function() {
  return {
      label: $terminal.getCols() + 'x' + $terminal.getRows(),
      icon: 'rectangle.expand.diagonal'
  } 
})();

Icon

rectangle.expand.diagonal

Compatibility

  • WebSSH >=30.5

  • iOS >=26.0

  • iPadOS >=26.0

  • macOS >=26.0

Supported Targets

  • Linux

  • macOS

  • FreeBSD

  • Windows

Needed Capabilities

The table below lists the capabilities required for this script to operate. Capabilities marked as “Safe” are generally considered secure. Capabilities with a “Warning” level indicate that, while they are typically acceptable, their safety cannot be fully guaranteed in all scenarios. For your peace of mind, we recommend reviewing the script before running it.

CapabilitySafety Level
terminal_get 🟢 Safe

Additional Information

This script displays the current terminal size in the state bar of WebSSH. It retrieves the number of rows and columns of the terminal using the $terminal.getCols() and $terminal.getRows() methods, and formats them as “columns x rows” for display. This can be useful for quickly checking the terminal size without needing to run additional commands or scripts.

This content is licensed under MIT by the author.