From b55197097fd0806a5c56cc214768c9b6a91f13db Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Fri, 29 May 2015 09:13:24 -0400 Subject: [PATCH] Set terminal type to xterm if X11 forwarding is used. Change-Id: Ic7c46a47772edb584abdb3bfa9d28a901cb495cc Signed-off-by: Greg Watson --- .../remote/internal/jsch/core/JSchProcessBuilder.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java index ceead2d9f1b..f12ff5c6c88 100644 --- a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java +++ b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java @@ -165,14 +165,19 @@ public class JSchProcessBuilder extends AbstractRemoteProcessBuilder { try { if (fShell) { fChannel = fConnection.getShellChannel(); - ((ChannelShell) fChannel).setPty((flags & ALLOCATE_PTY) == ALLOCATE_PTY); - ((ChannelShell) fChannel).setPtyType("vt100"); //$NON-NLS-1$ + if ((flags & ALLOCATE_PTY) == ALLOCATE_PTY) { + ((ChannelShell) fChannel).setPty(true); + ((ChannelShell) fChannel).setPtyType((flags & FORWARD_X11) == FORWARD_X11 ? "xterm" : "vt100"); //$NON-NLS-1$ //$NON-NLS-2$ + } RemoteDebugOptions.trace(RemoteDebugOptions.DEBUG_REMOTE_COMMANDS, "executing shell"); //$NON-NLS-1$ } else { fChannel = fConnection.getExecChannel(); String command = buildCommand(remoteCmd, env, clearEnv); ((ChannelExec) fChannel).setCommand(command); - ((ChannelExec) fChannel).setPty((flags & ALLOCATE_PTY) == ALLOCATE_PTY); + if ((flags & ALLOCATE_PTY) == ALLOCATE_PTY) { + ((ChannelExec) fChannel).setPty(true); + ((ChannelExec) fChannel).setPtyType((flags & FORWARD_X11) == FORWARD_X11 ? "xterm" : "vt100"); //$NON-NLS-1$ //$NON-NLS-2$ + } RemoteDebugOptions.trace(RemoteDebugOptions.DEBUG_REMOTE_COMMANDS, "executing command: " + command); //$NON-NLS-1$ } fChannel.setXForwarding((flags & FORWARD_X11) == FORWARD_X11);