Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrl+d ought result in EOF in ncdirect_readline() #2521

Closed
dankamongmen opened this issue Jan 3, 2022 · 6 comments · Fixed by #2528
Closed

ctrl+d ought result in EOF in ncdirect_readline() #2521

dankamongmen opened this issue Jan 3, 2022 · 6 comments · Fixed by #2528
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request input readin' dem bytes
Milestone

Comments

@dankamongmen
Copy link
Owner

Currently, ctrl+d in ncdirect_readline() just results in a capital D that can be erased and composed. It ought instead trigger an EOF. I'm undecided as to whether any existing text ought be delivered first.

See dankamongmen/growlight#154.

@dankamongmen dankamongmen added documentation Improvements or additions to documentation enhancement New feature or request input readin' dem bytes labels Jan 3, 2022
@dankamongmen dankamongmen added this to the 3.1.0 milestone Jan 3, 2022
@dankamongmen dankamongmen self-assigned this Jan 3, 2022
@dankamongmen
Copy link
Owner Author

we have:

   if(id == NCKEY_EOF || id == NCKEY_ENTER){                                                                                       
      if(id == NCKEY_ENTER){                                                                                                        
        if(fputc('\n', n->ttyfp) < 0){                                                                                              
          free(str);                                                                                                                
          return NULL;                                                                                                              
        }                                                                                                                           
      }else if(wused == 1){ // NCKEY_EOF 

shouldn't this be catching it?

@dankamongmen
Copy link
Owner Author

perhaps relatedly, cli1 < /dev/null just sits there, rather than exiting.

@dankamongmen
Copy link
Owner Author

perhaps relatedly, cli1 < /dev/null just sits there, rather than exiting.

and ctrl+cing out of cli1 crashes, jeepers =\

@dankamongmen
Copy link
Owner Author

palette_cb:1296:index 145 0xafafaf
process_escape:1877:walk result on 92 (\): 2 428
process_escape:1865:initialized automaton to 1
process_escape:1877:walk result on 93 (]): 0 399
process_escape:1877:walk result on 52 (4): 0 419
process_escape:1877:walk result on 59 (;): 0 420
process_escape:1877:walk result on 49 (1): 0 421
process_escape:1877:walk result on 52 (4): 0 421
process_escape:1877:walk result on 54 (6): 0 421
process_escape:1877:walk result on 59 (;): 0 422
process_escape:1877:walk result on 114 (r): 0 423
process_escape:1877:walk result on 103 (g): 0 424
process_escape:1877:walk result on 98 (b): 0 425
process_escape:1877:walk result on 58 (:): 0 426
process_escape:1877:walk result on 97 (a): 0 427
process_escape:1877:walk result on 102 (f): 0 427
process_escape:1877:walk result on 97 (a): 0 427
process_escape:1877:walk result on 102 (f): 0 427
process_escape:1877:walk result on 47 (/): 0 427
process_escape:1877:walk result on 97 (a): 0 427
process_escape:1877:walk result on 102 (f): 0 427
process_escape:1877:walk result on 97 (a): 0 427
process_escape:1877:walk result on 102 (f): 0 427
process_escape:1877:walk result on 47 (/): 0 427
process_escape:1877:walk result on 100 (d): 0 427
process_escape:1877:walk result on 55 (7): 0 427
process_escape:1877:walk result on 100 (d): 0 427
process_escape:1877:walk result on 55 (7): 0 427
process_escape:1877:walk result on 27 ( ): 0 429
palette_cb:1296:index 146 0xafafd7
process_escape:1877:walk result on 92 (\): 2 428
process_escape:1865:initialized automaton to 1
process_escape:1877:walk result on 93 (]): 0 399
process_escape:1877:walk result on 52 (4): 0 419
block_on_input:2133:blocking on input availability
block_on_input:2137:nonblocking read to check for completion
block_on_input:2178:output queues full; blocking on ipipes
block_on_input:2190:waiting on 2 fds (ibuf: 0/8192)
block_on_input:2217:poll returned 0
block_on_input:2231:got events: ti
growlight-readline: ./src/lib/in.c:1852: process_escape: Assertion `ictx->amata.used < buflen' failed.
;147;rgb:afaf/afaf/ffff^[\^[]4;148;rgb:afaf/d7d7/0000^[

@dankamongmen
Copy link
Owner Author

this followed a 2048 byte read

@dankamongmen
Copy link
Owner Author

so we need to be setting the input fd persistently high on the EOF case, for one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request input readin' dem bytes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant