runCommand STDERR not being picked up?

So I made a macro to help me execute perl scripts remotely(FTP vis SSH) from Komodo. It works fine normally and I get STDOUT just fine, but when there is any kind of error, STDERR and STDOUT is blank.

Here is my macro below:

print_to_output_tab = function(str) {
    try {
        ko.run.output.show(window, false);
        var runWidgetDoc = ko.widgets.getWidget("runoutput-desc-tabpanel").contentDocument;
        var deckWidget = runWidgetDoc.getElementById("runoutput-deck");
        if (deckWidget.getAttribute("selectedIndex") != 0) {
            ko.run.output.toggleView();
        }
        var scimoz = runWidgetDoc.getElementById("runoutput-scintilla").scimoz;
        var prevLength = scimoz.length;
        var currNL = ["\r\n", "\n", "\r"][scimoz.eOLMode];
        var full_str = str + currNL;
        var full_str_byte_length = ko.stringutils.bytelength(full_str);
        var ro = scimoz.readOnly;
        try {
            scimoz.readOnly = false;
            scimoz.clearAll();
            scimoz.appendText(full_str_byte_length, full_str);
        } finally {
            scimoz.readOnly = ro;
        }
        scimoz.gotoPos(prevLength + 1);
    } catch(ex) {
        alert("problems printing [" + str + "]:" + ex + "\n");
    }   }; 
function  getRemoteSSHConnection() {
        var remoteConnectionSvc = Components.classes["@activestate.com/koRemoteConnectionService;1"].
                getService(Components.interfaces.koIRemoteConnectionService);
        var view = ko.views.manager.currentView;
        var uri = view.document && view.document.file.URI || view.koDoc.file.URI; // Support K7 koDoc
        if (uri.substr(0, 1) != "s") {
            throw Error("The current file is not a remote SSH file. Open a remote file first.");
        }
        var conn = remoteConnectionSvc.getConnectionUsingUri(uri);
        if (conn) {
            conn.QueryInterface(Components.interfaces.koISSHConnection);
        }
        return conn
}

var stdout = {};
var stderr = {};
var filePath = ko.views.manager.currentView.koDoc.displayPath;
var re = new RegExp('^sftp://.*?(/.*?)$','');
var dirPath = filePath.replace(re,'$1');

var conn = getRemoteSSHConnection();
var retval = conn.runCommand( 'perl '+dirPath, false, stdout, stderr);
alert( JSON.stringify(conn) );

print_to_output_tab(stdout.value + "\n-error-\n" + stderr.value);

Try redirecting stderr to stdout:

conn.runComand( 'perl '+dirPath+' 2>&1', ...)

Is that sufficient? Or do you need stderr to be stored in the given variable?

I guess that should work sufficiently, just expected the stderr variable to work and was wondering if it was broken or not.

There are some oddities in the remote connections code, so while stderr ought to work ideally it’s probably not been hooked up for one technical reason or another. We’ll be overhauling a lot of that remote code in a future release so this should get fixed over time.