Skip to content

Commit

Permalink
JBIDE-17264 Respond to DSR with CPR to prevent console hangup.
Browse files Browse the repository at this point in the history
  • Loading branch information
VineetReynolds committed Aug 27, 2014
1 parent 91b3f3e commit 26c9a49
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@
*/
package org.jboss.tools.aesh.core.internal.ansi;


import org.jboss.aesh.util.ANSI;
import org.jboss.tools.aesh.core.document.Document;
import org.jboss.tools.aesh.core.internal.io.AeshInputStream;

public class DeviceStatusReport extends AbstractCommand {

private static char SEMI_COLON = ';';

public DeviceStatusReport(String arguments) {}

@Override
public CommandType getType() {
return CommandType.DEVICE_STATUS_REPORT;
}

@Override
public void handle(AeshInputStream inputStream, Document document) {
int row = document.getLineOfOffset(document.getCursorOffset());
int column = document.getLineOffset(row);
String reportCursorPosition = ANSI.getStart() + Integer.toString(row)
+ SEMI_COLON + Integer.toString(column) + 'R';
// Respond to the Device Status Report with a Cursor Position Report
inputStream.append(reportCursorPosition);
}

}

0 comments on commit 26c9a49

Please sign in to comment.