summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e6717a9)
reusing a window to restart a session.
git-svn-id: svn://svn.tartarus.org/sgt/putty@6577
cda61777-01e9-0310-a592-
d414129be87e
void term_size(Terminal *, int, int, int);
void term_paint(Terminal *, Context, int, int, int, int, int);
void term_scroll(Terminal *, int, int);
void term_size(Terminal *, int, int, int);
void term_paint(Terminal *, Context, int, int, int, int, int);
void term_scroll(Terminal *, int, int);
-void term_pwron(Terminal *);
+void term_pwron(Terminal *, int);
void term_clrsb(Terminal *);
void term_mouse(Terminal *, Mouse_Button, Mouse_Button, Mouse_Action,
int,int,int,int,int);
void term_clrsb(Terminal *);
void term_mouse(Terminal *, Mouse_Button, Mouse_Button, Mouse_Action,
int,int,int,int,int);
static void unlineptr(termline *);
static void do_paint(Terminal *, Context, int);
static void erase_lots(Terminal *, int, int, int);
static void unlineptr(termline *);
static void do_paint(Terminal *, Context, int);
static void erase_lots(Terminal *, int, int, int);
+static int find_last_nonempty_line(Terminal *, tree234 *);
static void swap_screen(Terminal *, int, int, int);
static void update_sbar(Terminal *);
static void deselect(Terminal *);
static void term_print_finish(Terminal *);
static void swap_screen(Terminal *, int, int, int);
static void update_sbar(Terminal *);
static void deselect(Terminal *);
static void term_print_finish(Terminal *);
+static void scroll(Terminal *, int, int, int, int);
#ifdef OPTIMISE_SCROLL
static void scroll_display(Terminal *, int, int, int);
#endif /* OPTIMISE_SCROLL */
#ifdef OPTIMISE_SCROLL
static void scroll_display(Terminal *, int, int, int);
#endif /* OPTIMISE_SCROLL */
/*
* Set up power-on settings for the terminal.
/*
* Set up power-on settings for the terminal.
+ * If 'clear' is false, don't actually clear the primary screen, and
+ * position the cursor below the last non-blank line (scrolling if
+ * necessary).
-static void power_on(Terminal *term)
+static void power_on(Terminal *term, int clear)
- term->curs.x = term->curs.y = 0;
term->alt_x = term->alt_y = 0;
term->savecurs.x = term->savecurs.y = 0;
term->alt_t = term->marg_t = 0;
term->alt_x = term->alt_y = 0;
term->savecurs.x = term->savecurs.y = 0;
term->alt_t = term->marg_t = 0;
swap_screen(term, 1, FALSE, FALSE);
erase_lots(term, FALSE, TRUE, TRUE);
swap_screen(term, 0, FALSE, FALSE);
swap_screen(term, 1, FALSE, FALSE);
erase_lots(term, FALSE, TRUE, TRUE);
swap_screen(term, 0, FALSE, FALSE);
- erase_lots(term, FALSE, TRUE, TRUE);
+ if (clear)
+ erase_lots(term, FALSE, TRUE, TRUE);
+ term->curs.y = find_last_nonempty_line(term, term->screen) + 1;
+ if (term->curs.y == term->rows) {
+ term->curs.y--;
+ scroll(term, 0, term->rows - 1, 1, TRUE);
+ }
+ } else {
+ term->curs.y = 0;
term_schedule_tblink(term);
term_schedule_cblink(term);
}
term_schedule_tblink(term);
term_schedule_cblink(term);
}
/*
* Same as power_on(), but an external function.
*/
/*
* Same as power_on(), but an external function.
*/
-void term_pwron(Terminal *term)
+void term_pwron(Terminal *term, int clear)
if (term->ldisc) /* cause ldisc to notice changes */
ldisc_send(term->ldisc, NULL, 0, 0);
term->disptop = 0;
if (term->ldisc) /* cause ldisc to notice changes */
ldisc_send(term->ldisc, NULL, 0, 0);
term->disptop = 0;
term->tabs = NULL;
deselect(term);
term->rows = term->cols = -1;
term->tabs = NULL;
deselect(term);
term->rows = term->cols = -1;
term->beephead = term->beeptail = NULL;
#ifdef OPTIMISE_SCROLL
term->scrollhead = term->scrolltail = NULL;
term->beephead = term->beeptail = NULL;
#ifdef OPTIMISE_SCROLL
term->scrollhead = term->scrolltail = NULL;
break;
case 'c': /* RIS: restore power-on settings */
compatibility(VT100);
break;
case 'c': /* RIS: restore power-on settings */
compatibility(VT100);
if (term->ldisc) /* cause ldisc to notice changes */
ldisc_send(term->ldisc, NULL, 0, 0);
if (term->reset_132) {
if (term->ldisc) /* cause ldisc to notice changes */
ldisc_send(term->ldisc, NULL, 0, 0);
if (term->reset_132) {
void reset_terminal_menuitem(GtkMenuItem *item, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
void reset_terminal_menuitem(GtkMenuItem *item, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
- term_pwron(inst->term);
+ term_pwron(inst->term, TRUE);
if (inst->ldisc)
ldisc_send(inst->ldisc, NULL, 0, 0);
}
if (inst->ldisc)
ldisc_send(inst->ldisc, NULL, 0, 0);
}
if (!inst->back) {
logevent(inst, "----- Session restarted -----");
if (!inst->back) {
logevent(inst, "----- Session restarted -----");
+ term_pwron(inst->term, FALSE);
start_backend(inst);
inst->exited = FALSE;
}
start_backend(inst);
inst->exited = FALSE;
}
case IDM_RESTART:
if (!back) {
logevent(NULL, "----- Session restarted -----");
case IDM_RESTART:
if (!back) {
logevent(NULL, "----- Session restarted -----");
+ term_pwron(term, FALSE);
term_clrsb(term);
break;
case IDM_RESET:
term_clrsb(term);
break;
case IDM_RESET:
+ term_pwron(term, TRUE);
if (ldisc)
ldisc_send(ldisc, NULL, 0, 0);
break;
if (ldisc)
ldisc_send(ldisc, NULL, 0, 0);
break;