X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fio%2FECMA48Terminal.java;h=174da85b266d03fe00889cbdb4bef0ecaa7cd7f6;hb=a2018e9964f6c58742cd1e6dd0a0c63e244a89d6;hp=a400ba2ec29a4ccd657ac55418abf5249e77e8d7;hpb=6985c57265a980ceeb8cb10a8677fe387adb3eb7;p=fanfix.git diff --git a/src/jexer/io/ECMA48Terminal.java b/src/jexer/io/ECMA48Terminal.java index a400ba2..174da85 100644 --- a/src/jexer/io/ECMA48Terminal.java +++ b/src/jexer/io/ECMA48Terminal.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2016 Kevin Lamonte + * Copyright (C) 2017 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -389,7 +389,12 @@ public final class ECMA48Terminal implements Runnable { sessionInfo = (SessionInfo) input; } if (sessionInfo == null) { - sessionInfo = new TSessionInfo(); + if (setRawMode == true) { + // Reading right off the tty + sessionInfo = new TTYSessionInfo(); + } else { + sessionInfo = new TSessionInfo(); + } } this.output = writer; @@ -1223,6 +1228,17 @@ public final class ECMA48Terminal implements Runnable { return "\033[?1036l"; } + /** + * Create an xterm OSC sequence to change the window title. Note package + * private access. + * + * @param title the new title + * @return the string to emit to xterm + */ + String setTitle(final String title) { + return "\033]2;" + title + "\007"; + } + /** * Create a SGR parameter sequence for a single color change. Note * package private access.