This function makes it easy to set accessibility "labels" for UI elements.
It is flexible - takes care of NSView vs. NSControl case, labels can be
specified directly as a string or as a user interface element.
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.
E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
This would happen for a command that is set to re-use previous output window (when busy). We would kill the running command and wait (in the main dispatch queue) for it to stop, but since the runner is (now) using GCD as well, and updating the “did exit” status in the main queue, we would wait forever.
Additionally we expect that any variable the user has set is properly shell escaped. Though this is only relevant if the value contains spaces or escape characters.
Currently bundle commands has not been updated to assume that the variables are already shell escaped, so this commit can cause issues with existing bundles.
The motivation for this change is that we may enable MallocDebug when running tests, which is done via environment variables that we do not want to be passed on to the shell tools we execute.
No file descriptors (other than input/output) should be inherited by our child process. We set FD_CLOEXEC ourself, but system frameworks might not always set it, or there might be a race condition (e.g. with socket(), pipe(), mkstemp(), etc.).
Failure to create a pipe does happen “in the wild” (with the error “too many open files”). Since majority of subprocess executions relate to gathering version control info we can probably ignore the failure, as not having version control info is better than crashing.
OTOH that pipe() fails does seem to be a symptom of a more serious issue.
The io::spawn implementation has also been updated to use io::create_pipe which sets FD_CLOEXEC, so there should be no reason to set this.
The latter is updated via a dispatch queue and thus might be delayed (to after end of current event loop cycle). This is relevant when WebView itself terminates the URL loading and calls the “WebView should close” delegate method.
Here the HTML output view property has been updated (via the WebView delegate method) but the command runner has not yet executed the completion code (which updates it’s “is running” state).
This can be set to ‘onDocumentChange’ to indicate that the command should be re-run when the document changes, though the code hasn’t yet been written to handle this.
We want to disable “make selection visible” when the user is drag-selecting, though the previous check was too broad and would disable it if user opened a document via double click (e.g. a find in folder result).
Previously we only updated the system pasteboard if it was different, but some users copy rich text from one application, paste it in TextMate and then copy it (in TextMate) with the expectation that the rich styles are stripped.
This ensures that ⌘Z / ⇧⌘Z are only targeting the file browser when it has focus.
Previously these keys would act on the file browser undo stack when a view without it’s own undo/redo stack had focus, e.g. HTML output view.