Skip to content

Commit

Permalink
Replaced deprecated methods in jediTerminal class
Browse files Browse the repository at this point in the history
1. getTerminalStarter() replaced with getTerminal()
2. used getCodeForKey() method to add new line character after command
  • Loading branch information
aparnamichael committed Jul 23, 2024
1 parent 4d00fcb commit 45dc626
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2022 IBM Corporation.
* Copyright (c) 2020, 2024 IBM Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -69,7 +69,7 @@ public static void executeCommand(ShellTerminalWidget widget, String cmd) {
return;
}
// existing terminal, add a new line character and send command through connector
String enterCode = new String(widget.getTerminalStarter().getCode(KeyEvent.VK_ENTER, 0), StandardCharsets.UTF_8);
String enterCode = new String(widget.getTerminal().getCodeForKey(KeyEvent.VK_ENTER, 0), StandardCharsets.UTF_8);
StringBuilder result = new StringBuilder();
result.append(cmd).append(enterCode);
connector.write(result.toString());
Expand Down

0 comments on commit 45dc626

Please sign in to comment.