Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFCORE-1315] CLI Double prompt when connecting to a new HC #1488

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1055,8 +1055,7 @@ public void bindClient(ModelControllerClient newClient) {
initNewClient(newClient, null, null);
}

private void initNewClient(ModelControllerClient newClient, ControllerAddress address,
ConnectionInfoBean conInfo) {
private void initNewClient(ModelControllerClient newClient, ControllerAddress address, ConnectionInfoBean conInfo) {
if (newClient != null) {
if (this.client != null) {
disconnectController();
Expand Down Expand Up @@ -1461,10 +1460,10 @@ public void interact() {
+ " 'help' for the list of supported commands.");
}

console.setPrompt(getPrompt());
if(!console.running()) {
console.start();
}
console.setPrompt(getPrompt());
if(console.isControlled()) {
console.continuous();
}
Expand Down
10 changes: 6 additions & 4 deletions cli/src/main/java/org/jboss/as/cli/impl/Console.java
Expand Up @@ -222,15 +222,15 @@ private String read(String prompt, Character mask) {
Prompt origPrompt = null;
if(!console.getPrompt().getPromptAsString().equals(prompt)) {
origPrompt = console.getPrompt();
console.setPrompt(new Prompt(prompt, mask));
console.updatePrompt(new Prompt(prompt, mask));
}
try {
return console.getInputLine();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
if(origPrompt != null) {
console.setPrompt(origPrompt);
console.updatePrompt(origPrompt);
}
}
} finally {
Expand Down Expand Up @@ -310,8 +310,10 @@ public void setPrompt(String prompt){

@Override
public void
setPrompt(String prompt, Character mask){
console.setPrompt(new Prompt(prompt, mask));
setPrompt(String prompt, Character mask) {
if(!prompt.equals(console.getPrompt().getPromptAsString())) {
console.updatePrompt(new Prompt(prompt, mask));
}
}

class HistoryImpl implements CommandHistory {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -94,7 +94,7 @@
<version.org.codehaus.woodstox.stax2-api>3.1.4</version.org.codehaus.woodstox.stax2-api>
<version.org.codehaus.woodstox.woodstox-core-asl>4.4.1</version.org.codehaus.woodstox.woodstox-core-asl>
<version.org.fusesource.jansi>1.11</version.org.fusesource.jansi>
<version.org.jboss.aesh>0.66.4</version.org.jboss.aesh>
<version.org.jboss.aesh>0.66.8</version.org.jboss.aesh>
<version.org.jboss.byteman>3.0.3</version.org.jboss.byteman>
<version.org.jboss.classfilewriter>1.1.2.Final</version.org.jboss.classfilewriter>
<version.org.jboss.invocation>1.4.1.Final</version.org.jboss.invocation>
Expand Down