WIP: Added timeout on read function #6
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Depends on
#2 Timeout for evomaintenance
evolix/evomaintenance
Reference: evolix/evomaintenance#6
Loading…
Reference in 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?
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Forgejo.