-
Couldn't load subscription status.
- Fork 63
Supress undef ERROR #165
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
Supress undef ERROR #165
Conversation
|
Hey, thank you really much for this PR! This is one of the most important things on our roadmap currently. I'll test it in the next days to make sure that all things still work. |
|
I have done testing on linux now and there are problems when exiting the raw mode of the terminal, sometimes it doesn't work and sometimes it works, but the terminal is not reverted back into it's original state completely. I'll investigate this, the current master doesn't have these issues. Do you have tested all examples on windows? @flagarde I'll look into fixing the linux side, when Windows does work well this should be simple. |
|
@MCWertGaming I have tested a bit on windows yes. It's compile and seems to have the same behaviour than before. On windows in didn't touch the code itselft so it should be fine. On Linux trying menu and doing CTRL-C I loose the caret too if it's what you mean ? |
|
Thanks @flagarde, this is indeed needed. Once the bugs are fixed, this can go in. Thanks @MCWertGaming for testing this! |
|
Okay, thank you for testing @flagarde, I'll do the testing on windows then as well. Especially the multiline prompt makes problems sometimes, so we should make sure that everything works well. I'll push the fix ones it's ready. Then I'll test windows and if that works, we are ready to merge! Thank you again. The PR is tracked in #159. |
|
@MCWertGaming on Windows the only changes have been done to move the headers to the cpp files so it should not change the behaviour. On Linux and I guess on Windows I think we always have a problem if we use signal handling to quit the program. |
|
@flagarde Windows and Linux works well because both systems have well build in support for the "raw mode" of the terminal that deactivates the terminal build in handling of user input and that stuff so we can process them in our application ourselves. This works fine, but I think that your change of the termio struct of the terminal class could have broken the terminal restoring. I'll look into this now. |
|
I have investigated the issues on Linux and came to the conclusion that it's just the window class from to: Where we can clearly see that the value change that will later be used for reverting the changes done to the terminal.
Is it possible that the I'm still not sure what the problem is. @flagarde could you look into this? |
|
I think that we shouldn't use pointers here, it'll cause a lot of trouble this way. What about either creating our own struct for termios, since it looks like this: #define NCCS 32
struct termios
{
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
tcflag_t c_lflag; /* local mode flags */
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS]; /* control characters */
speed_t c_ispeed; /* input speed */
speed_t c_ospeed; /* output speed */
#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
};So we would create a new struct with the same variables and then copy the data over from the termios struct for storing it and later copying it back into the original struct. Or we could try to imclude the The types the struct uses are |
|
@MCWertGaming I agree we could create our own struct but I'm not sure all have the same type for tcflag_t etc... This is required by the standard ? And as you mention, they don't want use to include only part of the termios stuffs I moved from const termios & to a unique_ptr this solved the warning on clang and I had to use a trick to avoid some problem in the destructor. |
|
@flagarde The types used by termios are standard types that got renamed (like on windows, where they have DWORD, which is a unsigned in and BYTE which is a char etc). So it would be possible of course. I'll test you changes though first. Thank you for looking into this! |
|
The codeQL check is failing because version 1 of it is deprecated soon. Sorry for that. I'll fix that separately. Just that you know. |
|
Seems like the CodeQL check worked now? Anyway, my testing on Linux succeeded, I think that this is fine now. I'll confirm that everything works on windows as well. When that works without a problem as well, this can be merged. Thank you really much for the fix @flagarde. |
|
I have done the Windows testing now and didn't found any new bugs in this branch. I'll merge it then. Really nice to see this project moving forward! |
Hi,
This changes allow to remove the #undef ERROR and to move most of the platform hearders to the cpp