term-size


License

License

MIT
GroupId

GroupId

com.github.duhemm
ArtifactId

ArtifactId

term-size_2.11
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

term-size
term-size
Project URL

Project URL

https://github.com/Duhemm/term
Project Organization

Project Organization

com.github.duhemm
Source Code Management

Source Code Management

https://github.com/Duhemm/term

Download term-size_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.duhemm/term-size_2.11/ -->
<dependency>
    <groupId>com.github.duhemm</groupId>
    <artifactId>term-size_2.11</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.duhemm/term-size_2.11/
implementation 'com.github.duhemm:term-size_2.11:0.1.0'
// https://jarcasting.com/artifacts/com.github.duhemm/term-size_2.11/
implementation ("com.github.duhemm:term-size_2.11:0.1.0")
'com.github.duhemm:term-size_2.11:jar:0.1.0'
<dependency org="com.github.duhemm" name="term-size_2.11" rev="0.1.0">
  <artifact name="term-size_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.duhemm', module='term-size_2.11', version='0.1.0')
)
libraryDependencies += "com.github.duhemm" % "term-size_2.11" % "0.1.0"
[com.github.duhemm/term-size_2.11 "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12

provided (2)

Group / Artifact Type Version
org.scala-lang : scala-reflect jar 2.11.12
com.github.duhemm : sbt-jni-macros_2.11 jar 1.4.4

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar 3.2.7

Project Modules

There are no modules declared in this project.

term-size - How large is the terminal window?

term-size exposes a platform-independent API to get the size of the current terminal window. On platform where the native library is available, term-size doesn't require forking a new process to get the terminal size. When the native library is unavailable, term-size uses tput to get the size of the current terminal.

Installation

term-size is available on Maven Central. Add the following to your build:

libraryDependencies += "com.github.duhemm" %% "term-size" % "<version>"

The latest version available is Maven Central

Example usage

object Main {
  def main(args: Array[String]): Unit = {
    val size = term.TermSize.size()
    println(s"Current terminal size: ${size.rows} rows and ${size.cols} columns.")
  }
}

Documentation: javadoc

Compatibility

Operating system / CPU architecture x86_64 x86_32 ARM
MacOS ๐Ÿš€ โœ… โœ…
Linux ๐Ÿš€ โœ… โœ…
Windows ๐Ÿš€ โŒ โŒ

๐Ÿš€ : Available, native
โœ… : Available, via Tput
โŒ : Unavailable

Versions

Version
0.1.0
0.0.1