Closed sboss closed 2 years ago
I dont know if this is "as-designed" or if it truly is a bug.
Don't know about delete but backspace should work. Can you post the exact 'ask' call that you are making.
There was a problem recently around this but I thought it had been fixed. Ultimately I want to add full line editing if we detect an ansi terminal.
Anything special about the terminal you are running in? e.g. is it an ansi terminal?
it is an ansi terminal. it is a bash shell prompt in MacOS. the shell is either Terminal.app or ShellCraft.app (form AppStore)
response = ask(' ', validator: Ask.required);
so nothing is going on odd that I can tell.
Can you add:
print('terminal: ${Terminal().hasTerminal}'); print('Ansi: ${Terminal().isAnsi}');
before the ask statement and report the output.
On linux the backspace works as expected. Delete won't work as we don't support cursor navigation so you can't move the cursor in front of a char to use delete.
S. Brett Sutton Noojee Contact Solutions 03 8320 8100
On Wed, 22 Sept 2021 at 11:56, scott @.***> wrote:
it is an ansi terminal. it is a bash shell prompt in MacOS. the shell is either Terminal.app or ShellCraft.app (form AppStore)
response = ask(' ', validator: Ask.required);
so nothing is going on odd that I can tell.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/noojee/dcli/issues/160#issuecomment-924518630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OGKFBMW7WMSGXDMXTTUDEZULANCNFSM5EP7EKIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
So I'm using stdion.readLineSync which means I'm reading a whole line at at time. Have a play it looks like the delete char is being handled deep in the dart vm.
I've we changed to using non-line mode then I can actually see the del character in the input stream.
can you run the following code:
void main(List<String> args) {
while (true) {
stdin.lineMode = false;
final byte = stdin.readByteSync();
if (byte < 0) {}
if (byte == 10 || byte == 14) break;
print('byte: $byte');
}
}
When its running type: a del
Then report the output.
Thanks.
Edit: added del key.
from your first response.
terminal: true
Ansi: true
from your second response
> dcli test.dart
abyte: 97
I switched to another terminal applicaton and backspace works. I believe that this was an issue was a user issue and not a real issue. sorry for the distraction.
--sb
Which terminal where you using? I would prefer that dcli works with all popular terminals.
S. Brett Sutton Noojee Contact Solutions 03 8320 8100
On Thu, 23 Sept 2021 at 07:43, scott @.***> wrote:
I switched to another terminal applicaton and backspace works. I believe that this was an issue was a user issue and not a real issue. sorry for the distraction.
--sb
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/noojee/dcli/issues/160#issuecomment-925352337, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OHAXYTOK42N2STOJI3UDJEYLANCNFSM5EP7EKIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Describe the bug ask() doesnt accept backspace/delete keys being touched and adds invalid characters/fails.
To Reproduce use ask() and hit the backspace/delete keys
Expected behavior that the line honors the backspace/delete keys.
Run dcli doctor: From the cli run
dcli doctor
Additional context Add any other context about the problem here.