diff -Naur omnitty-0.2.9/main.c omnitty-0.2.9-1/main.c --- omnitty-0.2.9/main.c 2004-10-28 02:45:07.000000000 +0200 +++ omnitty-0.2.9-1/main.c 2005-08-19 21:11:14.000000000 +0200 @@ -47,11 +47,16 @@ /* how many characters wide the list window will be, by default */ #define LISTWIN_DEFAULT_CHARS 8 +#define TERMWIN_DEFAULT_CHARS 80 +#define TERMWIN_MIN 80 -#define RTFM "Syntax: omnitty [-W list_width]\n" \ +#define RTFM "Syntax: omnitty [-W list_width] [-T term_width]\n" \ "\n" \ " -W specifies width of machine list area\n" \ " (default is 8 characters)\n" \ + "\n" \ + " -T specifies width of terminal area\n" \ + " (default is 80 characters)\n" \ "\n" static WINDOW *listwin = NULL; @@ -116,17 +121,18 @@ * * A = list_win_chars + 2 */ -void wins_init(int *vtrows, int *vtcols, int list_win_chars) { +void wins_init(int *vtrows, int *vtcols, int list_win_chars, int term_win_chars) { int termcols, termrows, A, B, C; const char *p; + printf("using list_width %i \nusing term_width %i\n", list_win_chars, term_win_chars); /* obtain terminal dimensions */ getmaxyx(stdscr, termrows, termcols); /* the geometry is hard-coded here, but nowhere else... so I don't * see a lot of point using #defines or anything any more sophisticated */ A = list_win_chars + 2; - C = termcols - 80; + C = termcols - term_win_chars; B = C-1; if (B < A) B = A, C = B + 1; @@ -299,23 +305,31 @@ } int main(int argc, char **argv) { - static char optstr[] = "W:"; int vtcols, vtrows, ch = 0; int list_win_chars = LISTWIN_DEFAULT_CHARS; + int term_win_chars = TERMWIN_DEFAULT_CHARS; bool quit = false; pid_t chldpid; /* process command-line options */ - while ( 0 < (ch = getopt(argc, argv, optstr)) ) { + while ( 0 < (ch = getopt(argc, argv, "W:T:")) ) { switch (ch) { case 'W': list_win_chars = atoi(optarg); break; + case 'T': term_win_chars = atoi(optarg); + if( term_win_chars < TERMWIN_MIN ) { + fprintf(stderr, " terminal area too narrow: %i\n", term_win_chars); + fputs(RTFM, stderr); + exit(2); + } + break; default: fputs(RTFM, stderr); exit(2); } } + printf("parsed args:\nlist_win_chars: %i\nterm_win_chars: %i\n", list_win_chars, term_win_chars); signal(SIGCHLD, sigchld_handler); curses_init(); - wins_init(&vtrows, &vtcols, list_win_chars); + wins_init(&vtrows, &vtcols, list_win_chars, term_win_chars); menu_init(minibuf); machmgr_init(listwin, vtrows, vtcols); diff -Naur omnitty-0.2.9/omnitty.1 omnitty-0.2.9-1/omnitty.1 --- omnitty-0.2.9/omnitty.1 2004-10-26 00:08:48.000000000 +0200 +++ omnitty-0.2.9-1/omnitty.1 2005-09-12 21:12:25.000000000 +0200 @@ -23,6 +23,13 @@ names, you might have to use this parameter to configure the desired width of the list window. +.TP +\fB-T\fR +specifies the width of the terminal window, if the default is not +satisfactory. For example, if you use omnitty in any X terminal with a +small font you can increase the with to see longer lines without +wrapping. + .SH PROJECT HOME PAGE The Omnitty Project's official homepage is the following: