-
Notifications
You must be signed in to change notification settings - Fork 0
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
UI/UX improvements #42
Conversation
ca1dc96
to
1378cf5
Compare
@PLangowski one thing I noticed that in case of error_exit your |
@m-iwanicki From what I see the screen is cleared only after the user presses a key, so they have time to read the error message |
@PLangowski I don't see any waiting for key press in case of error and there are plenty of places where error_exit() {
_error_msg="$1"
if [ -n "$_error_msg" ]; then
# Avoid printing empty line if no message was passed
print_error "$_error_msg"
fi
fum_exit
exit 1
}
error_check() {
_error_code=$?
_error_msg="$1"
[ "$_error_code" -ne 0 ] && error_exit "$_error_msg : ($_error_code)"
} |
Though maybe if it's called as another script then there are some guards against this, but there are lot of places to check so I'm not 100% sure |
I tested this and it seems that the functions that use |
@PLangowski there is functions used e.g. in |
@PLangowski quick test:
I'm not sure but it's possible it'd exit whole dts script so maybe it's not a problem that happens as we would have seen it before |
And now that I'm testing it more I'm not sure I like accepting without enter. |
1378cf5
to
11dda7a
Compare
@PLangowski If we accept any key then maybe we should clear stdin buffer before reading in case user pressed multiple keys earlier on accident. |
From what I see you can't really flush the input buffer in bash. I will change it back to accepting only enter |
5f81fb6
to
2944250
Compare
You can probably read up to e.g. 1'000'000 letters without blocking, that would probably clear the buffer. I think we sometimes use something similar in osfv tests. There is still case of |
does it exit from |
It exits current script. There are couple places where
|
7984afa |
@PLangowski yes, should probably work. Maybe wait for user input on all error codes, otherwise it's ok |
7984afa
to
78a7487
Compare
Signed-off-by: Pawel Langowski <[email protected]>
Signed-off-by: Pawel Langowski <[email protected]>
Signed-off-by: Pawel Langowski <[email protected]>
78a7487
to
8fbd2a9
Compare
Dasharo/dasharo-issues#1080