void (@NotNull String shellCommand, @NotNull TerminalStarter terminalStarter) { StringBuilder result = new StringBuilder(); if (terminalStarter.isLastSentByteEscape()) { result.append((char)KeyEvent.VK_BACK_SPACE); // remove Escape first, workaround for IDEA-221031 } String enterCode = new String(terminalStarter.getTerminal().getCodeForKey(KeyEvent.VK_ENTER, 0), StandardCharsets.UTF_8); result.append(shellCommand).append(enterCode); terminalStarter.sendString(result.toString(), false); }