Changeset 2358
- Timestamp:
- 06/11/08 17:45:02 (5 years ago)
- File:
-
- 1 edited
-
neercs/trunk/src/main.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/main.c
r2357 r2358 44 44 static caca_display_t *dp; 45 45 struct screen_list *screen_list = NULL; 46 int pty = 0, prevpty = 0, i, w, h, nt; 46 char *default_shell = NULL; 47 int pty = 0, prevpty = 0, i, w, h, nt, args = 0; 47 48 int eof = 0, refresh = 1, command = 0, mini = 1; 48 49 49 if(argc < 2)50 {51 fprintf(stderr, "usage: %s <cmd1> [<cmd2> [<cmd3> ...]]\n", argv[0]);52 fprintf(stderr, "eg. \"%s zsh bash\"\n", argv[0]);53 return 1;54 }55 56 50 nt = argc - 1; 51 args = nt; 52 53 if(nt == 0) 54 { 55 nt = 1; 56 } 57 default_shell = getenv("SHELL"); 58 57 59 58 60 /* Create main canvas and associated caca window */ … … 78 80 for(i = 0; i < nt; i++) 79 81 { 80 struct screen *tmp = create_screen(w, h, argv[i + 1]); 82 struct screen *tmp; 83 if(args) tmp = create_screen(w, h, argv[i + 1]); 84 else tmp = create_screen(w, h, default_shell); 85 81 86 if(tmp) 82 87 { … … 215 220 prevpty = pty; 216 221 pty = (pty + screen_list->count - 1) % screen_list->count; 222 refresh = 1; 223 break; 224 case 0x03: //CACA_KEY_CTRL_C: 225 prevpty = pty; 226 pty = add_screen(screen_list, create_screen(w, h, default_shell)); 217 227 refresh = 1; 218 228 break; … … 276 286 j * YTAB + 1, screen_list->screen[j]->cv, NULL); 277 287 cucul_draw_cp437_box(cv, (n - 1 - j) * XTAB, j * YTAB, 278 w + (n - 1 - j) * XTAB + 1, h + j * YTAB + 1);288 w + (n - 1 - j) * XTAB + 1, h + j * YTAB + 2); 279 289 /* Set cursor to the correct position */ 280 290 if(i == n - 1)
Note: See TracChangeset
for help on using the changeset viewer.
