diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-01-24 15:34:23 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-01-24 15:34:23 +0300 |
commit | cf886d0baf47c9f1cf58ed2278cb7b4bea0d808b (patch) | |
tree | d6d1e8768b3d0fb966105bf38f00a1e0519eb86b | |
parent | f069f787bad4ff1ffd3c662dc5b52920e9e1ccaa (diff) |
notes
-rw-r--r-- | notes.txt | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -10,3 +10,36 @@ disabling implicit reset on every eval in _p9k_worker_receive. - implement fake gitstatus api on top of vcs_info (or plain git?) + worker and use it if there is no gitstatus. + +zmodload zsh/system + +() { + emulate -L zsh + unsetopt monitor + setopt monitor + [[ -o monitor ]] && echo monitor on + typeset -gi fd + (( fd )) && exec {fd}>&- + sysopen -r -o cloexec -u fd <( + local pid=$sysparams[pid] + ( + echo $sysparams[pid] $sysparams[ppid] $pid >>/tmp/log + echo $pid + sleep 2 & + : <(sleep 3) + sleep 4 + sleep 5 + ) &) + sleep 1 + ps axjf + local pid + IFS= read -r -u $fd pid + kill -- -$pid + ps axjf + exec {fd}>&- + fd=0 +} + +_p9k_worker_await <(...) callback + +callback gets access to REPLY and STATUS; no prev |