File src/hstr.c changed (mode: 100644) (index 0a9af5e..5d11a7b) |
58 |
58 |
#endif |
#endif |
59 |
59 |
|
|
60 |
60 |
static const char *INSTALL_STRING= |
static const char *INSTALL_STRING= |
|
61 |
|
"\n# Add this configuration to ~/.bashrc to let HH load and flush up to date history" |
61 |
62 |
"\nshopt -s histappend" |
"\nshopt -s histappend" |
62 |
63 |
"\nexport PROMPT_COMMAND=\"history -a; history -n; ${PROMPT_COMMAND}\"" |
"\nexport PROMPT_COMMAND=\"history -a; history -n; ${PROMPT_COMMAND}\"" |
63 |
64 |
"\nbind '\"\\C-r\": \"\\C-k\\C-uhh\\C-j\"'" |
"\nbind '\"\\C-r\": \"\\C-k\\C-uhh\\C-j\"'" |
|
... |
... |
void hstr_on_exit(char *command) { |
314 |
315 |
|
|
315 |
316 |
void signal_callback_handler_ctrl_c(int signum) |
void signal_callback_handler_ctrl_c(int signum) |
316 |
317 |
{ |
{ |
317 |
|
hstr_on_exit(NULL); |
|
318 |
|
exit(signum); |
|
|
318 |
|
if(signum==SIGINT) { |
|
319 |
|
endwin(); |
|
320 |
|
hstr_on_exit(NULL); |
|
321 |
|
exit(signum); |
|
322 |
|
} |
319 |
323 |
} |
} |
320 |
324 |
|
|
321 |
325 |
char *selection_loop(HistoryItems *history) |
char *selection_loop(HistoryItems *history) |
322 |
326 |
{ |
{ |
323 |
|
//signal(SIGINT, signal_callback_handler_ctrl_c); |
|
|
327 |
|
signal(SIGINT, signal_callback_handler_ctrl_c); |
324 |
328 |
|
|
325 |
329 |
initscr(); |
initscr(); |
326 |
330 |
color_start(); |
color_start(); |