Skip to content

Commit a998eba

Browse files
committed
fixes #248
1 parent 74c6f83 commit a998eba

File tree

4 files changed

+57
-6
lines changed

4 files changed

+57
-6
lines changed

src/main/java/zos/shell/service/change/ChangeWinService.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,28 @@ public String setFontSize(final String size) {
5656
return null;
5757
}
5858

59-
}
59+
public String setPaneHeight(final String height) {
60+
LOG.debug("*** setPaneHeight ***");
61+
if (height != null) {
62+
try {
63+
terminal.getProperties().setPaneHeight(Integer.parseInt(height));
64+
} catch (NumberFormatException ignored) {
65+
}
66+
return "pane height " + height + " set";
67+
}
68+
return null;
69+
}
6070

71+
public String setPaneWidth(final String width) {
72+
LOG.debug("*** setPaneWidth ***");
73+
if (width != null) {
74+
try {
75+
terminal.getProperties().setPaneWidth(Integer.parseInt(width));
76+
} catch (NumberFormatException ignored) {
77+
}
78+
return "pane width " + width + " set";
79+
}
80+
return null;
81+
}
82+
83+
}

src/main/java/zos/shell/service/history/HistoryService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public void navigateHistory(NavigationDirection direction) {
3535
if (circularLinkedList.getSize() <= 0) {
3636
return;
3737
}
38-
38+
3939
var command = circularLinkedList.getSize() > 1
40-
? (direction == NavigationDirection.UP ? circularLinkedList.back() : circularLinkedList.forward())
41-
: circularLinkedList.head.getData();
42-
40+
? (direction == NavigationDirection.UP ? circularLinkedList.back() : circularLinkedList.forward())
41+
: circularLinkedList.head.getData();
42+
4343
TerminalSingleton.getInstance().getMainTerminal().replaceInput(command.trim(), false);
4444
}
4545

src/main/java/zos/shell/singleton/configuration/ConfigSingleton.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ public void updateWindowSittings(final TextTerminal<?> terminal) {
137137
result = windowCmd.setFontSize(window != null && window.getFontsize() != null ?
138138
configSettings.getWindow().getFontsize() : String.valueOf(Constants.DEFAULT_FONT_SIZE));
139139
str.append(result != null ? result : "");
140+
if (window != null && window.getPaneHeight() != null) {
141+
result = windowCmd.setPaneHeight(window.getPaneHeight());
142+
str.append(result != null ? "\n" + result : "");
143+
}
144+
if (window != null && window.getPaneWidth() != null) {
145+
result = windowCmd.setPaneWidth(window.getPaneWidth());
146+
str.append(result != null ? "\n" + result : "");
147+
}
140148
terminal.println(str.toString());
141149
}
142150

src/main/java/zos/shell/singleton/configuration/model/Window.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class Window {
66
private String fontBold;
77
private String textColor;
88
private String backGroundColor;
9+
private String paneHeight;
10+
private String paneWidth;
911

1012
public String getFontsize() {
1113
return fontsize;
@@ -39,14 +41,32 @@ public void setBackgroundcolor(final String backGroundColor) {
3941
this.backGroundColor = backGroundColor;
4042
}
4143

44+
public String getPaneHeight() {
45+
return paneHeight;
46+
}
47+
48+
public void setPaneHeight(String paneHeight) {
49+
this.paneHeight = paneHeight;
50+
}
51+
52+
public String getPaneWidth() {
53+
return paneWidth;
54+
}
55+
56+
public void setPaneWidth(String paneWidth) {
57+
this.paneWidth = paneWidth;
58+
}
59+
4260
@Override
4361
public String toString() {
4462
return "Window{" +
4563
"fontsize='" + fontsize + '\'' +
4664
", fontBold='" + fontBold + '\'' +
4765
", textColor='" + textColor + '\'' +
4866
", backGroundColor='" + backGroundColor + '\'' +
67+
", paneHeight='" + paneHeight + '\'' +
68+
", paneWidth='" + paneWidth + '\'' +
4969
'}';
5070
}
5171

52-
}
72+
}

0 commit comments

Comments
 (0)