summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4361847)
raw | patch | inline | side by side (parent: 4361847)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 15 Oct 2008 10:07:38 +0000 (12:07 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 15 Oct 2008 10:10:57 +0000 (12:10 +0200) |
When in pager mode, stdin should not be touched. After executing a run
request a getc(stdin) was done to wait for the user's command to
continue, which didn't result in the expected behavior. To fix this
store the proper TTY handle in the new opt_tty variable which is set up
by init_display().
request a getc(stdin) was done to wait for the user's command to
continue, which didn't result in the expected behavior. To fix this
store the proper TTY handle in the new opt_tty variable which is set up
by init_display().
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index d192439815163a81dd250b23f34d9f90b7c9f758..a0f75c62eda56cd4562fc94902c4102a0ed11602 100644 (file)
--- a/NEWS
+++ b/NEWS
- Separate blame revision and file argument by "--" to avoid problems.
- Main view: fix redrawing of the last commit wrt. the revision graph.
+ - Fix waiting for input after executing a run request in pager mode.
tig-0.12.1
----------
index b5078c0e2ebf074d6fbbc223b6679020970b86b0..3394d407472d3317d9cf9cc9d311db445706944b 100644 (file)
--- a/tig.c
+++ b/tig.c
static char opt_git_dir[SIZEOF_STR] = "";
static signed char opt_is_inside_work_tree = -1; /* set to TRUE or FALSE */
static char opt_editor[SIZEOF_STR] = "";
+static FILE *opt_tty = NULL;
static enum request
parse_options(int argc, const char *argv[])
endwin(); /* restore original tty modes */
system(cmd);
fprintf(stderr, "Press Enter to continue");
- getc(stdin);
+ getc(opt_tty);
reset_prog_mode();
redraw_display();
}
/* Initialize the curses library */
if (isatty(STDIN_FILENO)) {
cursed = !!initscr();
+ opt_tty = stdin;
} else {
/* Leave stdin and stdout alone when acting as a pager. */
- FILE *io = fopen("/dev/tty", "r+");
-
- if (!io)
+ opt_tty = fopen("/dev/tty", "r+");
+ if (!opt_tty)
die("Failed to open /dev/tty");
- cursed = !!newterm(NULL, io, io);
+ cursed = !!newterm(NULL, opt_tty, opt_tty);
}
if (!cursed)