mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Merge pull request #458 from ailin-nemui/fix_449
Properly toggle bracketed paste mode on stop/cont
This commit is contained in:
commit
3bc8afa740
@ -6,7 +6,7 @@
|
||||
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
||||
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
|
||||
|
||||
#define IRSSI_ABI_VERSION 2
|
||||
#define IRSSI_ABI_VERSION 3
|
||||
|
||||
#define DEFAULT_SERVER_ADD_PORT 6667
|
||||
|
||||
|
@ -710,11 +710,3 @@ void term_gets(GArray *buffer, int *line_count)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void term_set_bracketed_paste_mode(int enable)
|
||||
{
|
||||
if (enable)
|
||||
tputs("\e[?2004h", 0, term_putchar);
|
||||
else
|
||||
tputs("\e[?2004l", 0, term_putchar);
|
||||
}
|
||||
|
@ -395,6 +395,14 @@ static void _ignore_parm(TERM_REC *term, int param)
|
||||
{
|
||||
}
|
||||
|
||||
static void term_dec_set_bracketed_paste_mode(int enable)
|
||||
{
|
||||
if (enable)
|
||||
tputs("\e[?2004h", 0, term_putchar);
|
||||
else
|
||||
tputs("\e[?2004l", 0, term_putchar);
|
||||
}
|
||||
|
||||
static void term_fill_capabilities(TERM_REC *term)
|
||||
{
|
||||
int i, ival;
|
||||
@ -535,6 +543,9 @@ void terminfo_cont(TERM_REC *term)
|
||||
if (term->TI_smkx)
|
||||
tput(tparm(term->TI_smkx));
|
||||
|
||||
if (term->bracketed_paste_enabled)
|
||||
term_dec_set_bracketed_paste_mode(TRUE);
|
||||
|
||||
terminfo_input_init(term);
|
||||
}
|
||||
|
||||
@ -545,6 +556,9 @@ void terminfo_stop(TERM_REC *term)
|
||||
/* move cursor to bottom of the screen */
|
||||
terminfo_move(0, term->height-1);
|
||||
|
||||
if (term->bracketed_paste_enabled)
|
||||
term_dec_set_bracketed_paste_mode(FALSE);
|
||||
|
||||
/* stop cup-mode */
|
||||
if (term->TI_rmcup)
|
||||
tput(tparm(term->TI_rmcup));
|
||||
@ -677,6 +691,15 @@ static int term_setup(TERM_REC *term)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void term_set_bracketed_paste_mode(int enable)
|
||||
{
|
||||
if (current_term->bracketed_paste_enabled == enable)
|
||||
return;
|
||||
|
||||
current_term->bracketed_paste_enabled = enable;
|
||||
term_dec_set_bracketed_paste_mode(enable);
|
||||
}
|
||||
|
||||
TERM_REC *terminfo_core_init(FILE *in, FILE *out)
|
||||
{
|
||||
TERM_REC *old_term, *term;
|
||||
|
@ -92,6 +92,9 @@ struct _TERM_REC {
|
||||
/* Keyboard-transmit mode */
|
||||
const char *TI_smkx;
|
||||
const char *TI_rmkx;
|
||||
|
||||
/* Terminal mode states */
|
||||
int bracketed_paste_enabled;
|
||||
};
|
||||
|
||||
extern TERM_REC *current_term;
|
||||
|
Loading…
Reference in New Issue
Block a user