diff options
author | dteske <dteske@FreeBSD.org> | 2014-08-03 05:02:00 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2014-08-03 05:02:00 +0000 |
commit | bb5ee87f44d555c2a39c5aaee81db0ee96020655 (patch) | |
tree | e04bef89c9a0d3834ee590bf8fac8885c9a33f9a /usr.sbin | |
parent | 283af5830e8f0751a16bd406de93686b35f39291 (diff) | |
download | FreeBSD-src-bb5ee87f44d555c2a39c5aaee81db0ee96020655.zip FreeBSD-src-bb5ee87f44d555c2a39c5aaee81db0ee96020655.tar.gz |
Add required `exec' before Xdialog(1) invocation for the case where we
expect (require) data on stdin. The effect of this is that, when
backgrounded, $! returns the pid of an Xdialog(1) instance instead of
an sh(1) instance -- the difference being a later kill of $! will reach
the Xdialog(1) instance whereas without the exec the kill succeeds on
the sh(1) instance leaving Xdialog(1) open.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bsdconfig/share/dialog.subr | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr index e887bca..49e72ee 100644 --- a/usr.sbin/bsdconfig/share/dialog.subr +++ b/usr.sbin/bsdconfig/share/dialog.subr @@ -1557,12 +1557,22 @@ f_dialog_info() # EOF. This implies that you must execute this either as an rvalue to a pipe, # lvalue to indirection or in a sub-shell that provides data on stdin. # +# To open an Xdialog(1) infobox that does not disappear until expeclitly dis- +# missed, use the following: +# +# f_xdialog_info "$info_text" < /dev/tty & +# pid=$! +# # Perform some lengthy actions +# kill $pid +# +# NB: Check $USE_XDIALOG if you need to support both dialog(1) and Xdialog(1). +# f_xdialog_info() { local info_text="$*" height width f_dialog_infobox_size height width \ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$info_text" - $DIALOG \ + exec $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --no-close --no-buttons \ |