Skip to content

Commit

Permalink
Fixed ansi clr_eos sequences on windows, #481
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Dec 9, 2019
1 parent d0f52f0 commit 238f020
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
8 changes: 0 additions & 8 deletions terminal/src/main/java/org/jline/utils/InfoCmp.java
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,4 @@ static String loadDefaultInfoCmp(String name) {
}
}

static boolean support(String terminal, Capability capability) {
if ((terminal.equals("windows") || terminal.equals("windows-256color"))
&& (capability == Capability.clr_eos)) {
return false;
}
return true;
}

}
6 changes: 2 additions & 4 deletions terminal/src/main/java/org/jline/utils/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ public void update(List<AttributedString> lines) {
}
}
terminal.puts(Capability.save_cursor);
if (InfoCmp.support(terminal.getType(), Capability.clr_eos)) {
terminal.puts(Capability.cursor_address, rows - statusSize, 0);
terminal.puts(Capability.clr_eos);
} else {
terminal.puts(Capability.cursor_address, rows - statusSize, 0);
if (!terminal.puts(Capability.clr_eos)) {
for (int i = rows - statusSize; i < rows; i++) {
terminal.puts(Capability.cursor_address, i, 0);
terminal.puts(Capability.clr_eol);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ windows-256color|windows with 256 colors terminal compatibility,
il=\E[%p1%dL, il1=\E[L,
dl=\E[%p1%dM, dl1=\E[M,
ech=\E[%p1%dX,
el=\E[K, ed=\E[2K,
el=\E[K, ed=\E[J,
el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG,
ind=^J,
invis=\E[8m, kbs=^H, kcbt=\E[Z,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ windows-conemu|conemu windows terminal,
il=\E[%p1%dL, il1=\E[L,
dl=\E[%p1%dM, dl1=\E[M,
ech=\E[%p1%dX,
el=\E[K, ed=\E[2K,
el=\E[K, ed=\E[J,
el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG,
ind=^J,
invis=\E[8m, kbs=^H, kcbt=\E[Z,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ windows-vtp|windows with virtual terminal processing,
il=\E[%p1%dL, il1=\E[L,
dl=\E[%p1%dM, dl1=\E[M,
ech=\E[%p1%dX,
el=\E[K, ed=\E[2K,
el=\E[K, ed=\E[J,
el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG,
ind=^J,
invis=\E[8m, kbs=^H, kcbt=\E[Z,
Expand Down
2 changes: 1 addition & 1 deletion terminal/src/main/resources/org/jline/utils/windows.caps
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ windows|windows terminal compatibility,
il=\E[%p1%dL, il1=\E[L,
dl=\E[%p1%dM, dl1=\E[M,
ech=\E[%p1%dX,
el=\E[K, ed=\E[2K,
el=\E[K, ed=\E[J,
el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG,
ind=^J,
invis=\E[8m, kbs=^H, kcbt=\E[Z,
Expand Down

0 comments on commit 238f020

Please sign in to comment.