mirror of
https://github.com/urbit/shrub.git
synced 2024-12-18 15:55:00 +03:00
Merge pull request #6167 from joemfb/ctrl-z-replay
vere: support ctrl-z in play command
This commit is contained in:
commit
f095679e02
@ -1780,6 +1780,17 @@ _cw_play_slog(u3_noun hod)
|
|||||||
u3z(hod);
|
u3z(hod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* _cw_play_exit(): exit immediately.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
_cw_play_exit(c3_i int_i)
|
||||||
|
{
|
||||||
|
// explicit fprintf to avoid allocation in u3l_log
|
||||||
|
//
|
||||||
|
fprintf(stderr, "\r\n[received keyboard stop signal, exiting]\r\n");
|
||||||
|
raise(SIGINT);
|
||||||
|
}
|
||||||
|
|
||||||
/* _cw_play(): replay events, but better.
|
/* _cw_play(): replay events, but better.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -1859,10 +1870,16 @@ _cw_play(c3_i argc, c3_c* argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XX handle SIGTSTP so that the lockfile is not orphaned?
|
|
||||||
//
|
|
||||||
u3_disk* log_u = _cw_disk_init(u3_Host.dir_c); // XX s/b try_aquire lock
|
u3_disk* log_u = _cw_disk_init(u3_Host.dir_c); // XX s/b try_aquire lock
|
||||||
|
|
||||||
|
#if !defined(U3_OS_mingw)
|
||||||
|
// Handle SIGTSTP as if it was SIGINT.
|
||||||
|
//
|
||||||
|
// Configured here using signal() so as to be immediately available.
|
||||||
|
//
|
||||||
|
signal(SIGTSTP, _cw_play_exit);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( c3y == mel_o ) {
|
if ( c3y == mel_o ) {
|
||||||
u3C.wag_w |= u3o_auto_meld;
|
u3C.wag_w |= u3o_auto_meld;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ u3_mars_play(u3_mars* mar_u, c3_d eve_d)
|
|||||||
fprintf(stderr, "mars: boot fail\r\n");
|
fprintf(stderr, "mars: boot fail\r\n");
|
||||||
// XX exit code, cb
|
// XX exit code, cb
|
||||||
//
|
//
|
||||||
exit(1);;
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
mar_u->sen_d = mar_u->dun_d = lif_w;
|
mar_u->sen_d = mar_u->dun_d = lif_w;
|
||||||
@ -231,6 +231,7 @@ u3_mars_play(u3_mars* mar_u, c3_d eve_d)
|
|||||||
// XX check loom size, suggest --loom X
|
// XX check loom size, suggest --loom X
|
||||||
// XX exit code, cb
|
// XX exit code, cb
|
||||||
//
|
//
|
||||||
|
u3_disk_exit(log_u);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,6 +255,7 @@ u3_mars_play(u3_mars* mar_u, c3_d eve_d)
|
|||||||
u3m_save();
|
u3m_save();
|
||||||
// XX exit code, cb
|
// XX exit code, cb
|
||||||
//
|
//
|
||||||
|
u3_disk_exit(log_u);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user