static int taskbgrun(RThread *th) {
	char *res;
	RCoreTask *task = th->user;
	RCore *core = task->core;
	close (2); // no stderr
	res = r_core_cmd_str (core, task->msg->text);
	task->msg->res = res;
	task->state = 'd';
	eprintf ("Task %d finished\n", task->id);
// TODO: run callback and pass result
	return 0;
}
static int taskbgrun(RThread *th) {
	char *res;
	RCoreTask *task = th->user;
	RCore *core = task->core;
	close (2);  
	res = r_core_cmd_str (core, task->msg->text);
	task->msg->res = res;
	task->state = 'd';
	eprintf ("Task %d finished\n", task->id);
 
	return 0;
}