diff --git a/eval.go b/eval.go index 3b3eab12..ff04308e 100644 --- a/eval.go +++ b/eval.go @@ -920,6 +920,10 @@ func (e *setExpr) eval(app *app, args []string) { // any key with the prefix user_ is accepted as a user defined option if strings.HasPrefix(e.opt, "user_") { gOpts.user[e.opt[5:]] = e.val + // Export user defined options immediately, so that the current values + // are available for some external previewer, which is started in a + // different thread and thus cannot export (as `setenv` is not thread-safe). + os.Setenv("lf_"+e.opt, e.val) } else { app.ui.echoerrf("unknown option: %s", e.opt) }