WIP: Added timeout on read function #6
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#2 Timeout for evomaintenance
evolix/evomaintenance
Reference: evolix/evomaintenance#6
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "timeout-read"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created timedout_read() function which uses TMOUT env variable, inspired by http://www.tldp.org/LDP/abs/html/internalvariables.html#TIMEOUT
Remember to run shellcheck, besides that it seems to run fine on OpenBSD.
@ -66,0 +71,4 @@
user_input=$1
old_tty_settings=$(stty -g)
stty -icanon min 0 time ${TMOUT}0
read $user_input
10:2: note: read without -r will mangle backslashes. [SC2162]
10:7: note: Double quote to prevent globbing and word splitting. [SC2086]
Strange that it didn't erase the review automatically.
Added timeout on read functionto WIP: Added timeout on read functionNeed to be tested on OpenBSD and regular shell.
So should this function be killing my xterm after a while?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.