File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 21
21
"require" : {
22
22
"php" : " >=7.1" ,
23
23
"beberlei/assert" : " ^2.4 | ^3" ,
24
- "php-school/terminal" : " dev-master " ,
24
+ "php-school/terminal" : " ^0.2 " ,
25
25
"ext-posix" : " *"
26
26
},
27
27
"autoload" : {
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ public function disableDefaultControlMappings() : void
214
214
public function setDefaultControlMappings (array $ defaultControlMappings ) : void
215
215
{
216
216
$ this ->defaultControlMappings = $ defaultControlMappings ;
217
- }
217
+ }
218
218
219
219
/**
220
220
* Adds a custom control mapping
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ public function collect(Input $input) : InputResult
40
40
41
41
$ inputValue = $ input ->getPlaceholderText ();
42
42
$ havePlaceHolderValue = !empty ($ inputValue );
43
+
44
+ $ originalValue = $ inputValue ;
43
45
44
46
$ reader = new NonCanonicalReader ($ this ->terminal );
45
47
@@ -59,6 +61,9 @@ public function collect(Input $input) : InputResult
59
61
60
62
if ($ char ->isHandledControl ()) {
61
63
switch ($ char ->getControl ()) {
64
+ case InputCharacter::ESC :
65
+ $ this ->parentMenu ->redraw ();
66
+ return new InputResult ($ originalValue );
62
67
case InputCharacter::ENTER :
63
68
if ($ input ->validate ($ inputValue )) {
64
69
$ this ->parentMenu ->redraw ();
You can’t perform that action at this time.
0 commit comments