Skip to main content

Module external_open

Module external_open 

Source
Expand description

A value handed to another program: the inspector’s o.

The value is written read-only to a file of its own, with an extension that says what it is. Text goes to the user’s $VISUAL, $EDITOR or $PAGER (then less), run in the terminal while datui steps aside, and the file is removed when it returns; nothing is read back. Images and PDFs, and text when no program is named, go to the system’s opener (xdg-open, open, or Windows’ start, which asks which program to use when none is set), which returns at once, so their files stay until datui quits.

Structs§

ExternalOpen
A file to open, written and waiting for the run loop.

Enums§

Program
How a file is opened.

Functions§

file_name
A file name for a value: the field’s name with anything a path cannot hold replaced, the row, and the extension.
program_for
The program for a file, from the environment env looks up: a document goes to the opener; text to $VISUAL, $EDITOR, $PAGER, then less outside Windows, then the opener. A program set to blank counts as unset. Its words are split at spaces, so code --wait runs code with --wait.
run
Run program on path: wait for one that takes the terminal, start one that does not. The caller has handed the terminal over for a wait.
start
Start argv as a program, no shell between, and return without waiting: it opens a window of its own. A thread reaps it when it exits.
write_value
Write bytes to name in dir, read-only. A name already taken, by an earlier open of the same value, takes a number.