1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Remove non-working detach/attach code.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4806 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-04-19 15:01:16 +00:00 committed by exg
parent e361d2f498
commit 7bd938542e
4 changed files with 3 additions and 76 deletions

View File

@ -377,10 +377,6 @@ void term_stop(void)
irssi_redraw();
}
void term_auto_detach(int set)
{
}
void term_set_input_type(int type)
{
}

View File

@ -47,7 +47,6 @@ static char *term_lines_empty; /* 1 if line is entirely empty */
static int vcmove, vcx, vcy, curs_visible;
static int crealx, crealy, cforcemove;
static int curs_x, curs_y;
static int auto_detach;
static int last_fg, last_bg, last_attrs;
@ -106,7 +105,6 @@ int term_init(void)
term_width = current_term->width;
term_height = current_term->height;
root_window = term_window_create(0, 0, term_width, term_height);
term_detached = FALSE;
term_lines_empty = g_new0(char, term_height);
@ -130,8 +128,6 @@ void term_deinit(void)
static void term_move_real(void)
{
if (term_detached) return;
if (vcx != crealx || vcy != crealy || cforcemove) {
if (curs_visible) {
terminfo_set_cursor_visible(FALSE);
@ -194,16 +190,12 @@ int term_has_colors(void)
/* Force the colors on any way you can */
void term_force_colors(int set)
{
if (term_detached) return;
terminfo_setup_colors(current_term, set);
}
/* Clear screen */
void term_clear(void)
{
if (term_detached) return;
term_set_color(root_window, ATTR_RESET);
terminfo_clear();
term_move_reset(0, 0);
@ -214,8 +206,6 @@ void term_clear(void)
/* Beep */
void term_beep(void)
{
if (term_detached) return;
terminfo_beep(current_term);
}
@ -252,8 +242,6 @@ void term_window_clear(TERM_WINDOW *window)
{
int y;
if (term_detached) return;
terminfo_set_normal();
if (window->y == 0 && window->height == term_height) {
term_clear();
@ -270,8 +258,6 @@ void term_window_scroll(TERM_WINDOW *window, int count)
{
int y;
if (term_detached) return;
terminfo_scroll(window->y, window->y+window->height-1, count);
term_move_reset(vcx, vcy);
@ -285,8 +271,6 @@ void term_set_color(TERM_WINDOW *window, int col)
{
int set_normal;
if (term_detached) return;
set_normal = ((col & ATTR_RESETFG) && last_fg != -1) ||
((col & ATTR_RESETBG) && last_bg != -1);
if (((last_attrs & ATTR_BOLD) && (col & ATTR_BOLD) == 0) ||
@ -387,8 +371,6 @@ static void term_printed_text(int count)
void term_addch(TERM_WINDOW *window, char chr)
{
if (term_detached) return;
if (vcmove) term_move_real();
if (vcy < term_height-1 || vcx < term_width-1) {
@ -416,8 +398,6 @@ static void term_addch_utf8(TERM_WINDOW *window, unichar chr)
void term_add_unichar(TERM_WINDOW *window, unichar chr)
{
if (term_detached) return;
if (vcmove) term_move_real();
if (vcy == term_height-1 && vcx == term_width-1)
return; /* last char in screen */
@ -447,8 +427,6 @@ void term_addstr(TERM_WINDOW *window, const char *str)
{
int len;
if (term_detached) return;
if (vcmove) term_move_real();
len = strlen(str); /* FIXME utf8 or big5 */
term_printed_text(len);
@ -461,8 +439,6 @@ void term_addstr(TERM_WINDOW *window, const char *str)
void term_clrtoeol(TERM_WINDOW *window)
{
if (term_detached) return;
/* clrtoeol() doesn't necessarily understand colors */
if (last_fg == -1 && last_bg == -1 &&
(last_attrs & (ATTR_UNDERLINE|ATTR_REVERSE)) == 0) {
@ -488,7 +464,7 @@ void term_move_cursor(int x, int y)
void term_refresh(TERM_WINDOW *window)
{
if (term_detached || freeze_counter > 0)
if (freeze_counter > 0)
return;
term_move(root_window, curs_x, curs_y);
@ -514,43 +490,12 @@ void term_refresh_thaw(void)
term_refresh(NULL);
}
void term_auto_detach(int set)
{
auto_detach = set;
}
void term_detach(void)
{
terminfo_stop(current_term);
fclose(current_term->in);
fclose(current_term->out);
current_term->in = NULL;
current_term->out = NULL;
term_detached = TRUE;
}
void term_attach(FILE *in, FILE *out)
{
current_term->in = in;
current_term->out = out;
term_detached = FALSE;
terminfo_cont(current_term);
irssi_redraw();
}
void term_stop(void)
{
if (term_detached) {
kill(getpid(), SIGTSTP);
} else {
terminfo_stop(current_term);
kill(getpid(), SIGTSTP);
terminfo_cont(current_term);
irssi_redraw();
}
}
static int input_utf8(const unsigned char *buffer, int size, unichar *result)
@ -612,18 +557,12 @@ void term_gets(void)
{
int ret, i, char_len;
if (term_detached)
return;
/* fread() doesn't work */
ret = read(fileno(current_term->in),
term_inbuf + term_inbuf_pos, sizeof(term_inbuf)-term_inbuf_pos);
if (ret == 0) {
/* EOF - terminal got lost */
if (auto_detach)
term_detach();
else
ret = -1;
} else if (ret == -1 && (errno == EINTR || errno == EAGAIN))
ret = 0;

View File

@ -38,7 +38,7 @@
#define MIN_SCREEN_WIDTH 20
int term_width, term_height, term_detached;
int term_width, term_height;
int term_use_colors;
int term_type;
@ -116,8 +116,6 @@ static void read_settings(void)
int old_colors = term_use_colors;
int old_type = term_type;
term_auto_detach(settings_get_bool("term_auto_detach"));
/* set terminal type */
str = settings_get_str("term_charset");
if (g_ascii_strcasecmp(str, "utf-8") == 0)
@ -150,7 +148,6 @@ void term_common_init(void)
#endif
settings_add_bool("lookandfeel", "colors", TRUE);
settings_add_bool("lookandfeel", "term_force_colors", FALSE);
settings_add_bool("lookandfeel", "term_auto_detach", FALSE);
settings_add_bool("lookandfeel", "mirc_blink_fix", FALSE);
force_colors = FALSE;

View File

@ -24,7 +24,7 @@ typedef guint32 unichar;
extern TERM_WINDOW *root_window;
extern int term_width, term_height;
extern int term_use_colors, term_type, term_detached;
extern int term_use_colors, term_type;
/* Initialize / deinitialize terminal */
int term_init(void);
@ -77,11 +77,6 @@ void term_refresh_freeze(void);
void term_refresh_thaw(void);
void term_refresh(TERM_WINDOW *window);
/* Automatically detach irssi when terminal is lost */
void term_auto_detach(int set);
void term_detach(void);
void term_attach(FILE *in, FILE *out);
void term_stop(void);
/* keyboard input handling */