- All Superinterfaces:
AutoCloseable
,Closeable
,InputProvider
,Scrollable
,Terminal
- All Known Subinterfaces:
IOSafeExtendedTerminal
- All Known Implementing Classes:
ANSITerminal
,CygwinTerminal
,IOSafeTerminalAdapter.Extended
,TelnetTerminal
,UnixLikeTerminal
,UnixLikeTTYTerminal
,UnixTerminal
This class extends the normal Terminal interface and adds a few more methods that are considered rare and shouldn't
be encouraged to be used. Some of these may move into Terminal if it turns out that they are indeed well-supported.
Most of these extensions are picked up from here: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
This class is not considered stable and may change within releases. Do not depend on methods in this interface
unless you are ok with occasionally having to fix broken code after minor library upgrades.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
De-iconifies the terminal, which likely means restoring it from minimized state with most window managersvoid
iconify()
Iconifies the terminal, this likely means minimizing the window with most window managersvoid
maximize()
Maximizes the terminal, so that it takes up all available spacevoid
popTitle()
Replaces the terminal title with the top element from the title stack managed by the terminal (the element is removed from the stack as expected)void
Saves the current window title on a stack managed internally by the terminal.void
setMouseCaptureMode
(MouseCaptureMode mouseCaptureMode) Enabled or disables capturing of mouse event.void
setTerminalSize
(int columns, int rows) Attempts to resize the terminal through dtterm extensions "CSI 8 ; rows ; columns ; t".void
This methods sets the title of the terminal, which is normally only visible if you are running the application in a terminal emulator in a graphical environment.void
Restores the terminal back to its previous size, after having been maximizedMethods inherited from interface com.googlecode.lanterna.input.InputProvider
pollInput, readInput
Methods inherited from interface com.googlecode.lanterna.graphics.Scrollable
scrollLines
Methods inherited from interface com.googlecode.lanterna.terminal.Terminal
addResizeListener, bell, clearScreen, close, disableSGR, enableSGR, enquireTerminal, enterPrivateMode, exitPrivateMode, flush, getCursorPosition, getTerminalSize, newTextGraphics, putCharacter, putString, removeResizeListener, resetColorAndSGR, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColor
-
Method Details
-
setTerminalSize
Attempts to resize the terminal through dtterm extensions "CSI 8 ; rows ; columns ; t". This isn't widely supported, which is why the method is not exposed through the common Terminal interface.- Parameters:
columns
- New size (columns)rows
- New size (rows)- Throws:
IOException
- If the was an underlying I/O error
-
setTitle
This methods sets the title of the terminal, which is normally only visible if you are running the application in a terminal emulator in a graphical environment.- Parameters:
title
- Title to set on the terminal- Throws:
IOException
- If the was an underlying I/O error
-
pushTitle
Saves the current window title on a stack managed internally by the terminal.- Throws:
IOException
- If the was an underlying I/O error
-
popTitle
Replaces the terminal title with the top element from the title stack managed by the terminal (the element is removed from the stack as expected)- Throws:
IOException
- If the was an underlying I/O error
-
iconify
Iconifies the terminal, this likely means minimizing the window with most window managers- Throws:
IOException
- If the was an underlying I/O error
-
deiconify
De-iconifies the terminal, which likely means restoring it from minimized state with most window managers- Throws:
IOException
- If the was an underlying I/O error
-
maximize
Maximizes the terminal, so that it takes up all available space- Throws:
IOException
- If the was an underlying I/O error
-
unmaximize
Restores the terminal back to its previous size, after having been maximized- Throws:
IOException
- If the was an underlying I/O error
-
setMouseCaptureMode
Enabled or disables capturing of mouse event. This is not recommended to use as most users are not familiar with the fact that terminal emulators allow capturing mouse input. You can decide which events you want to capture but be careful since different terminal emulators will support these modes differently. Mouse capture mode will be automatically disabled when the application exits through a shutdown hook.- Parameters:
mouseCaptureMode
- Which mouse events to capture, pass innull
to disable mouse input capturing- Throws:
IOException
- If the was an underlying I/O error
-