zsh-workers
 help / color / mirror / code / Atom feed
1fc17c03b77dc5e4477c17b61fb373d94d13307c blob 1064 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
#
# Restarts the shell if and only if it can restart without error.
#

emulate -LR zsh
{
  # Some users export $ZDOTDIR, which can mess things up.
  local zdotdir=$ZDOTDIR
  unset ZDOTDIR
  
  print 'Validating...'
  
  # Try if the shell can start up without errors. Passing an empty command 
  # ensures that the subshell exits immediately after executing all dotfiles.
  # We suppress standard out, since we're interested in standard error only.
  setopt multios
  local err="$(zsh --interactive --monitor --zle -c '' 2>&1 > /dev/null)"
  local -i ret=$?
  
  if (( ret )) || [[ -n $err ]]; then
    [[ -n $err ]] &&
        print -ru2 -- "$err"
    print -nu2 'Validation failed'
    (( ret )) &&
        print -nu2 " with exit status $ret"
    [[ -n $err ]] &&
        print -nu2 '. Please fix the error(s) above'
    print -u2 '.'
    print -u2 'Restart aborted.'
    
    (( ret )) ||
        (( ret = 64 ))  # EX_DATAERR; see `man 3 sysexits`.
        
    return ret
    
  else
    print 'Restarting...'
    exec zsh
  fi
} always {
  ZDOTDIR=$zdotdir
}
debug log:

solving 1fc17c03b ...
found 1fc17c03b in https://inbox.vuxu.org/zsh-workers/CAHLkEDu2hWS8GQg4deQbHgVYxfj_Jm-tF6aa1hBP0JtgnB7WNg@mail.gmail.com/

applying [1/1] https://inbox.vuxu.org/zsh-workers/CAHLkEDu2hWS8GQg4deQbHgVYxfj_Jm-tF6aa1hBP0JtgnB7WNg@mail.gmail.com/
diff --git a/Functions/Misc/zrestart b/Functions/Misc/zrestart
new file mode 100644
index 000000000..1fc17c03b

1:16: trailing whitespace.
  
1:18: trailing whitespace.
  
1:19: trailing whitespace.
  # Try if the shell can start up without errors. Passing an empty command 
1:25: trailing whitespace.
  
1:36: trailing whitespace.
    
Checking patch Functions/Misc/zrestart...
Applied patch Functions/Misc/zrestart cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

index at:
100644 1fc17c03b77dc5e4477c17b61fb373d94d13307c	Functions/Misc/zrestart

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).