-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add autoterminal #98
Add autoterminal #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small review:
- use oscore (
src/oscore.h
) insted of pthread directly - fix code formatting, make CI compile this successfully
Code looks good, now that it allocates a PTY and does threading, it's really nice! :)
build.sr.ht needs to have ncurse installed, otherwise it can’t compile the terminfo file with Codecy is just rediculous. |
Apparently Edit: |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good now!
Just a few nitpicks.
src/modules/gfx_autoterminal.c
Outdated
active_shell = 1; | ||
type_index++; | ||
type_pos = 0; | ||
oscore_task_create("shell", launch, type_buffer[type_index - 1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should store the thread handle and join it when it is done, otherwise you'll be leaking memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oscore_event_*
is not suitable, I don’t wanna block draw. I need some polling.
I always draw the buffer and I only want to do the autotyping if no child process is running.
You can add Travis complains differently... https://travis-ci.com/shinyblink/sled/jobs/274459240#L262
shrug |
|
Can you prefix it? Having something global with |
I postfixed it for whatever reason, I think I’ll go with: #include "printbuffer.h"
printbuffer_init_default();
printbuffer_write_default("foo", 12, 42);//just writes to the buffer
// write understands \n and \r, but \r will jump to column 0
printbuffer_draw_default();//draws whole buffer
printbuffer_deinit(); EDIT: I renamed it |
|
Also translate some characters with altcode equivalents
That is incredible! |
Tested cmatrix and pipes.sh with 32x64
It’s pretty much finnished now. I think it could be merged as soon as I support multiple scripts.
|
|
op fixes htop this terminfo file was created with tic -I
I added a little utility script that sends EDIT: Since ./next 30 & while true; do sleep 5; echo '^'; sleep 5; echo '$'; done | htop |
It’s not finished yet.
A PTY and multithreading is used now.
Terminal capabilities get communicated via a custom terminfo file.
Broken:
Also do: