From 37aa12df9179bf3248e1e60a92b0c9ce27cf449c Mon Sep 17 00:00:00 2001 From: Martin Oberhuber Date: Thu, 21 Feb 2013 22:39:09 +0100 Subject: [PATCH] [401386] Regression: No header on top due to incorrect ESC[K handling Change-Id: I5b2b584728c8f271de4b2089c2739a5fcb86bd5b Signed-off-by: Martin Oberhuber --- .../tm/internal/terminal/emulator/VT100Emulator.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java index c693708e802..6c0a953ebc8 100644 --- a/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java +++ b/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100Emulator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 Wind River Systems, Inc. and others. + * Copyright (c) 2003, 2013 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,6 +18,7 @@ * Michael Scharf (Wind River) - [262996] get rid of TerminalState.OPENED * Martin Oberhuber (Wind River) - [334969] Fix multi-command SGR sequence * Kris De Volder (VMWare) - [392107] Switched interpretation for ESC[0K and ESC[1K sequences + * Martin Oberhuber (Wind River) - [401386] Regression: No header on top due to incorrect ESC[K interpretation *******************************************************************************/ package org.eclipse.tm.internal.terminal.emulator; @@ -661,7 +662,10 @@ public class VT100Emulator implements ControlListener { * moving the cursor. */ private void processAnsiCommand_K() { - int ansiParameter = getAnsiParameter(0); + //Bug 401386: missing parameter must be interpreted as 0, and not 1 like most other defaults. + int ansiParameter = 0; + if (ansiParameters[0].length() > 0) + ansiParameter = getAnsiParameter(0); switch (ansiParameter) { case 0: