Skip to content

Commit

Permalink
default-config: Don't close terminal if manpage not found.
Browse files Browse the repository at this point in the history
When viewing a manual page using the "Help" menu in the
default-config, if the manual page is not found, don't close
the terminal, instead use the 'read' command to wait for user
input. This will require the user to hit 'Enter' or close the
terminal manually.

This ensures that if the manual pages are not installed the
user gets a message from man saying that the manual page cannot
be found vs just flashing a terminal.
  • Loading branch information
somiaj committed Oct 17, 2024
1 parent b2fe1e0 commit 31d0e42
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions default-config/config
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ AddToFunc MoveToCurrent
# Function: ViewManPage $0
#
# This function loads the man page $0 in an terminal
# and is used with the help menu.
# and is used with the help menu. If the manual page is
# not found, point users at fvwm.org and keep terminal open.
DestroyFunc ViewManPage
AddToFunc ViewManPage
+ I Exec exec $[infostore.terminal] -g 80x40 \
-n "Manual Page - $0" -T "Manual Page - $0" -e man "$0"
-n "Manual Page - $0" -T "Manual Page - $0" -e 'man "$0" || \
(echo "$[gt.Documenation can be found at https://www.fvwm.org]"; \
read tmp)'

# Function: SetBG $0
#
Expand Down Expand Up @@ -702,4 +705,4 @@ DestroyModuleConfig EventNewDesk:*
# exists, then read it. This allows changes to default-config settings
# without needing a full copy of the default-config. This will also allow
# default-config changes to get used after upgrades (if applicable).
Test (f $[FVWM_USERDIR]/local.config) Read $[FVWM_USERDIR]/local.config
Test (f $[FVWM_USERDIR]/local.config) Read $[FVWM_USERDIR]/local.config

0 comments on commit 31d0e42

Please sign in to comment.