Skip to content

Commit 5810e28

Browse files
committed
deploy: prepare deployment
1 parent 4c6d6e6 commit 5810e28

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.2.1
2+
- The ask component disappeared after the validation stage
3+
- Calling `createSpace` method in all rendering cases for `ask` component
4+
- Remove missing `print` statement in `readKey` function
5+
16
# 2.2.0
27
- Add `select` display handler
38
- Fix bad FutureOr execution

lib/src/application/components/ask.dart

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
4545
Future<T> handle() {
4646
saveCursorPosition();
4747

48-
createSpace(_terminal, 1);
49-
5048
_defaultRendering();
5149
_waitResponse();
5250

@@ -87,6 +85,7 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
8785
SetStyles(Style.foreground(Color.brightBlack)),
8886
]);
8987

88+
createSpace(_terminal, 1);
9089
stdout.write(buffer.toString());
9190
}
9291

@@ -100,6 +99,8 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
10099
];
101100

102101
buffer.writeAnsiAll([
102+
CursorPosition.restore,
103+
Clear.afterCursor,
103104
...errorSequence,
104105
Print(_message),
105106
if (_hasDefault) ..._baseDefaultSequence,
@@ -111,21 +112,14 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
111112
SetStyles(Style.foreground(Color.brightRed)),
112113
Print(error),
113114
SetStyles.reset,
114-
CursorPosition.restore,
115-
Clear.afterCursor,
116-
]);
117-
118-
buffer.writeAnsiAll([
119-
CursorPosition.restore,
120-
Clear.afterCursor,
121-
SetStyles(Style.foreground(Color.brightBlack)),
122115
]);
123116

117+
createSpace(_terminal, 2);
124118
stdout.write(buffer.toString());
125119

126120
stdout.writeAnsiAll([
127121
const CursorPosition.moveUp(1),
128-
const CursorPosition.moveRight(2),
122+
SetStyles(Style.foreground(Color.brightBlack)),
129123
]);
130124

131125
_waitResponse();
@@ -142,17 +136,17 @@ final class Ask<T> with TerminalTools implements Component<Future<T>> {
142136
];
143137

144138
buffer.writeAnsiAll([
139+
CursorPosition.restore,
140+
Clear.afterCursor,
145141
...successSequence,
146142
Print(_message),
147143
Print(' '),
148144
SetStyles(Style.foreground(Color.brightBlack)),
149145
Print(_hidden ? '******' : response),
150146
SetStyles.reset,
151147
AsciiControl.lineFeed,
152-
CursorPosition.restore,
153-
Clear.afterCursor,
154148
]);
155-
149+
createSpace(_terminal, 1);
156150
stdout.write(buffer.toString());
157151

158152
_completer.complete(response as T);

lib/src/application/utils/terminal_tools.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ mixin TerminalTools {
113113
_ensureTerminalAttached();
114114
terminal.enableRawMode();
115115
final key = _readKey();
116-
print(key.controlChar);
117116
terminal.disableRawMode();
118117

119118
if (key.controlChar == ControlCharacter.ctrlC) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: commander_ui
22
description: Commander is a Dart library for creating user interfaces within the terminal.
3-
version: 2.2.0
3+
version: 2.2.1
44
repository: https://github.com/LeadcodeDev/commander
55

66
topics:

0 commit comments

Comments
 (0)