History

Last ditch effort to notify user that there are unseen error messages

malc committed 6 years ago

Commit 6f8905e1 parent 22d20c72 files · +10 −2Browse files

Unified · Split

2 files
  1. main.ml +7 −0
  2. todo.org +3 −2
main.ml+7−0
@@ -5087,6 +5087,7 @@ let () = · 5086 unmodified lines
50875087 then String.sub css 0 (l-2)
50885088 else (if css.[l-1] = '\n' then String.sub css 0 (l-1) else css)
50895089 end;
5090+ let efd = try Unix.dup Unix.stderr with _ -> Unix.stdout in
50905091 state.stderr <-
50915092 Ffi.init cs (
50925093 conf.angle, conf.fitmodel, (conf.trimmargins, conf.trimfuzz),
@@ -5236,6 +5237,12 @@ let () = · 143 unmodified lines
52365237 in
52375238 match loop infinity with
52385239 | exception Quit ->
5240+ (try
5241+ let s = Buffer.contents state.errmsgs in
5242+ match String.length s with
5243+ | 0 -> ()
5244+ | n -> ignore @@ Unix.write efd (Bytes.of_string s) 0 n
5245+ with _ -> ());
52395246 Config.save leavebirdseye;
52405247 if Ffi.hasunsavedchanges ()
52415248 then save ()
todo.org+3−2
@@ -35,9 +35,10 @@ · 34 unmodified lines
3535 a) die doesn't really
3636 b) especially in bocaml where subshell was used ("(" instead of "{")
3737 why? i don't remember :(
38−* DONE stderr
39− CLOSED: [2020-10-25 Sun 05:41]
38+* DONE ? stderr
39+ CLOSED: [2020-10-25 Sun 10:48]
4040 cf. 89c908a345f2b6a0f0e15ba2009c87c880b95cb8
4141 ml_spawn uses posix_spawn (/bin/sh -c ...)
4242 /bin/sh reparts errors via stderr, thus making them
4343 completely hidden from the UI
44+ maybe it makes sense to pipe leftover errmsgs to some congiurable sink

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t