From e18761003e4023d6f1520000288546ffaef369be Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 10 Dec 2024 20:55:23 +0100 Subject: [PATCH] Add a AbstractTerminal#toString() method --- .../org/jline/terminal/impl/AbstractPosixTerminal.java | 9 +++++++++ .../java/org/jline/terminal/impl/AbstractTerminal.java | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/terminal/src/main/java/org/jline/terminal/impl/AbstractPosixTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/AbstractPosixTerminal.java index 6d8649f72..98b65bc12 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/AbstractPosixTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/AbstractPosixTerminal.java @@ -94,4 +94,13 @@ public TerminalProvider getProvider() { public SystemStream getSystemStream() { return getPty().getSystemStream(); } + + @Override + public String toString() { + return getKind() + "[" + "name='" + + name + '\'' + ", pty='" + + pty + '\'' + ", type='" + + type + '\'' + ", size='" + + getSize() + '\'' + ']'; + } } diff --git a/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java index dfe225d38..2a6044f01 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java @@ -287,4 +287,12 @@ public boolean paused() { public ColorPalette getPalette() { return palette; } + + @Override + public String toString() { + return getKind() + "[" + "name='" + + name + '\'' + ", type='" + + type + '\'' + ", size='" + + getSize() + '\'' + ']'; + } }