From 5f6b27c97c9b094e266ed7cc6050f49377e18df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Dar=C3=B3czi?= Date: Mon, 22 Oct 2012 21:29:07 +0200 Subject: [PATCH 1/3] add: LilyTerm support (rather POC demo instead of a full-blown solution) LilyTerm: https://github.com/Tetralet/LilyTerm --- connmgr.py | 2 +- terminals.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/connmgr.py b/connmgr.py index 1f55e2b..a025b1d 100644 --- a/connmgr.py +++ b/connmgr.py @@ -39,7 +39,7 @@ VERSION = '0.7.4' -supportedTerms = ["Gnome Terminal", "Terminator", "Guake"] +supportedTerms = ["Gnome Terminal", "Terminator", "Guake", 'LilyTerm'] # TreeStore object: # Type, Name, Host, Profile, Protocol diff --git a/terminals.js b/terminals.js index 97997fd..8fa2f66 100644 --- a/terminals.js +++ b/terminals.js @@ -17,7 +17,7 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Supported terminals. This terminal list must match as in connmgr.py -const TERMINALS = new Array("gnome-terminal", "terminator", "guake"); +const TERMINALS = new Array("gnome-terminal", "terminator", "guake", 'lilyterm'); // ****************************************************** @@ -35,6 +35,9 @@ function TerminalCommand(terminal) { case 2: this.resClass = new GuakeCommand(terminal); break; + case 3: + this.resClass = new LilyTermCommand(terminal); + break; default: this.resClass = new GnomeTerminalCommand(terminal); break; @@ -257,4 +260,75 @@ function GuakeCommand(terminal) { } +// ****************************************************** +// LilyTerm class derived from base class +// ****************************************************** +function LilyTermCommand(terminal) { + this._init(terminal); +} + + LilyTermCommand.prototype = { + __proto__: TerminalCommand.prototype, + + createCmd: function () { + + if (this.child.Type == '__item__') { + this._setParams(); + + this.command += this.cmdTerm; + + if (this.sshparams && this.sshparams.length > 0) { + this.command = this.sshparams + ' ' + this.command; + } + + this.command += ' --title ' + (this.child.Name).quote(); + this.command += ' -s -H -e ' + (this.child.Protocol + " " + this.sshparams_noenv).quote(); + + this.command = 'sh -c ' + this.command.quote(); + + } + + if (this.child.Type == '__app__') { + + if (this.child.Protocol == 'True') { + this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -s -H -e '; + } + this.command += this.child.Host; + } + + return this.command; + }, + + createTabCmd: function () { + + if (this.child.Type == '__item__') { + this._setParams(); + + this.command += this.cmdTerm; + + if (this.sshparams && this.sshparams.length > 0) { + this.command = this.sshparams + ' ' + this.command; + } + + this.command += ' --title ' + (this.child.Name).quote(); + this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -H -e '; this.command += ' -H -e ' + (this.child.Protocol + " " + this.sshparams_noenv).quote(); + + this.command = 'sh -c ' + this.command.quote(); + + } + + if (this.child.Type == '__app__') { + + if (this.child.Protocol == 'True') { + this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -H -e '; + } + this.command += this.child.Host; + } + + return this.command; + + } + +} + From 00901b831db82064f9f10c5903aace0fd3ed2ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Dar=C3=B3czi?= Date: Tue, 23 Oct 2012 20:58:46 +0200 Subject: [PATCH 2/3] fix: removing quotes for a bare minimal working example --- terminals.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/terminals.js b/terminals.js index 8fa2f66..18d3564 100644 --- a/terminals.js +++ b/terminals.js @@ -273,6 +273,7 @@ function LilyTermCommand(terminal) { createCmd: function () { if (this.child.Type == '__item__') { + this._setParams(); this.command += this.cmdTerm; @@ -282,9 +283,8 @@ function LilyTermCommand(terminal) { } this.command += ' --title ' + (this.child.Name).quote(); - this.command += ' -s -H -e ' + (this.child.Protocol + " " + this.sshparams_noenv).quote(); - - this.command = 'sh -c ' + this.command.quote(); + this.command += ' -s -H -e ' + this.child.Protocol + " " + this.sshparams_noenv; + this.command = this.command; } @@ -293,15 +293,19 @@ function LilyTermCommand(terminal) { if (this.child.Protocol == 'True') { this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -s -H -e '; } + this.command += this.child.Host; + } return this.command; + }, createTabCmd: function () { if (this.child.Type == '__item__') { + this._setParams(); this.command += this.cmdTerm; @@ -310,10 +314,9 @@ function LilyTermCommand(terminal) { this.command = this.sshparams + ' ' + this.command; } - this.command += ' --title ' + (this.child.Name).quote(); - this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -H -e '; this.command += ' -H -e ' + (this.child.Protocol + " " + this.sshparams_noenv).quote(); - - this.command = 'sh -c ' + this.command.quote(); + // tab renaming on the command line is not supported yet: https://github.com/Tetralet/LilyTerm/issues/22 + this.command += ' -H -e ' + this.child.Protocol + " " + this.sshparams_noenv; + this.command = this.command; } @@ -322,7 +325,9 @@ function LilyTermCommand(terminal) { if (this.child.Protocol == 'True') { this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -H -e '; } + this.command += this.child.Host; + } return this.command; From 4f1a2495b4cbc9c868bbbd4a73bfa9d8cab96b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Dar=C3=B3czi?= Date: Fri, 26 Oct 2012 14:27:04 +0200 Subject: [PATCH 3/3] add tab naming based on @Tetralet's awesome updates: Tetralet/LilyTerm#22 --- terminals.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/terminals.js b/terminals.js index 18d3564..de0589c 100644 --- a/terminals.js +++ b/terminals.js @@ -275,26 +275,26 @@ function LilyTermCommand(terminal) { if (this.child.Type == '__item__') { this._setParams(); - this.command += this.cmdTerm; - if (this.sshparams && this.sshparams.length > 0) { - this.command = this.sshparams + ' ' + this.command; - } + this.command += ' --separate --hold'; + this.command += ' --title ' + (this.child.Name).quote(); - this.command += ' --title ' + (this.child.Name).quote(); - this.command += ' -s -H -e ' + this.child.Protocol + " " + this.sshparams_noenv; - this.command = this.command; + this.command += ' --execute ' + this.child.Protocol + " " + this.sshparams_noenv; } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -s -H -e '; + + this.command += this.cmdTerm; + this.command += ' --separate --hold'; + this.command += ' --title ' + (this.child.Name).quote(); + } - this.command += this.child.Host; + this.command += ' --execute ' + this.child.Host; } @@ -307,26 +307,26 @@ function LilyTermCommand(terminal) { if (this.child.Type == '__item__') { this._setParams(); - this.command += this.cmdTerm; - if (this.sshparams && this.sshparams.length > 0) { - this.command = this.sshparams + ' ' + this.command; - } + this.command += ' --join --hold'; + this.command += ' --tab_names ' + (this.child.Name).quote(); - // tab renaming on the command line is not supported yet: https://github.com/Tetralet/LilyTerm/issues/22 - this.command += ' -H -e ' + this.child.Protocol + " " + this.sshparams_noenv; - this.command = this.command; + this.command += ' --execute ' + this.child.Protocol + " " + this.sshparams_noenv; } if (this.child.Type == '__app__') { if (this.child.Protocol == 'True') { - this.command += this.cmdTerm + ' --title ' + (this.child.Name).quote() + ' -H -e '; + + this.command += this.cmdTerm; + this.command += ' --join --hold'; + this.command += ' --tab_names ' + (this.child.Name).quote() + } - this.command += this.child.Host; + this.command += ' --execute ' + this.child.Host; }