Commit Graph

20 Commits

Author SHA1 Message Date
Allan Odgaard
6359a2ef7c Use symbolic exit success/failure constants 2014-04-21 17:05:35 +07:00
Allan Odgaard
ec6d0b7e4e fixup! Add assertion about being called in the main dispatch queue 2014-04-11 20:54:13 +07:00
Allan Odgaard
6d1da8ce97 Use bundle item’s effective name in error and cancel sheets
For example the bundle item “Execute Line / Selection” will (without a selection) show as “Execute Line” in the menu, and now also if the command causes the error sheet to appear or the user press ⌃C / ⌘. to prematurely kill it.
2014-04-09 15:15:36 +07:00
Allan Odgaard
7bb584c604 Add assertion about being called in the main dispatch queue 2014-04-08 15:43:19 +07:00
Allan Odgaard
f93f793bc5 Keep dispatch group around as we may call wait after process exit 2014-04-02 14:02:28 +07:00
Allan Odgaard
a735a37b9b We shouldn’t (potentially) call fprintf() after vfork()
Since it was only incase of failing to close a file descriptor, it shouldn’t have played any role in practice.
2014-04-02 12:36:07 +07:00
Allan Odgaard
589e62b1a7 File descriptors without FD_CLOEXEC are closed before we execve()
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.).
2014-03-29 13:44:13 +07:00
Allan Odgaard
7a66926231 Let command::runner_t use io::create_pipe 2014-03-29 09:57:10 +07:00
Allan Odgaard
dac27f7587 Use constants for input, output, and error file descriptors 2014-03-29 09:57:09 +07:00
Allan Odgaard
d985a83845 Use runner_t::wait_for_command instead of runner_t::wait(true)
The latter API has been removed.
2014-03-29 09:57:09 +07:00
Allan Odgaard
ffd034453a Extend command::runner_t API 2014-03-29 09:57:09 +07:00
Allan Odgaard
c9400e036d Use std::string for memory management 2014-03-28 19:31:15 +07:00
Allan Odgaard
935da75a43 Use new path::temp API to set initial content 2014-03-28 19:31:15 +07:00
Allan Odgaard
1fbf878a4d Refactor/simplify command runner 2014-03-28 19:31:15 +07:00
Allan Odgaard
45b297a150 Use custom code instead of process_t 2014-03-28 10:19:06 +07:00
Allan Odgaard
1e2f10ed46 Use dispatch queue instead of a thread for reading command output 2014-03-28 10:19:06 +07:00
Allan Odgaard
9d218ea846 We use camelCase for parameter names 2014-03-28 10:19:06 +07:00
Allan Odgaard
112a3a9e80 Allow aborting commands by pressing ⌘. or ⌃C 2014-02-12 15:50:13 +07:00
Allan Odgaard
f128304d75 Handle non-mouse/key events while running commands
Fixes textmate/diff.tmbundle#5
2014-02-12 11:33:37 +07:00
Allan Odgaard
1c14143575 Switch file from C++ to Objective-C++ 2014-02-12 11:15:29 +07:00