mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-24 04:50:27 +02:00
26301: make zpty -r exit more cleanly on bad reads
add option -m to make zpty -r return status 1 if pattern failed to match use this option in comptest
This commit is contained in:
parent
e763f79b3f
commit
e7c9e03c58
4 changed files with 46 additions and 21 deletions
|
|
@ -80,7 +80,7 @@ comptesteval () {
|
|||
|
||||
print -lr - "$@" > $tmp
|
||||
zpty -w zsh ". $tmp"
|
||||
zpty -r zsh log_eval "*<PROMPT>*" || {
|
||||
zpty -r -m zsh log_eval "*<PROMPT>*" || {
|
||||
print "prompt hasn't appeared."
|
||||
return 1
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ comptesteval () {
|
|||
comptest () {
|
||||
input="$*"
|
||||
zpty -n -w zsh "$input"$'\C-Z'
|
||||
zpty -r zsh log "*<WIDGET><finish>*<PROMPT>*" || {
|
||||
zpty -r -m zsh log "*<WIDGET><finish>*<PROMPT>*" || {
|
||||
print "failed to invoke finish widget."
|
||||
return 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue