special hack for treating top line --More-- as a one item menu */
| 2816 | |
| 2817 | /* special hack for treating top line --More-- as a one item menu */ |
| 2818 | char |
| 2819 | tty_message_menu(char let, int how, const char *mesg) |
| 2820 | { |
| 2821 | HUPSKIP_RESULT('\033'); |
| 2822 | /* "menu" without selection; use ordinary pline, no more() */ |
| 2823 | if (how == PICK_NONE) { |
| 2824 | pline("%s", mesg); |
| 2825 | return 0; |
| 2826 | } |
| 2827 | |
| 2828 | ttyDisplay->dismiss_more = let; |
| 2829 | morc = 0; |
| 2830 | /* barebones pline(); since we're only supposed to be called after |
| 2831 | response to a prompt, we'll assume that the display is up to date */ |
| 2832 | tty_putstr(WIN_MESSAGE, 0, mesg); |
| 2833 | /* if `mesg' didn't wrap (triggering --More--), force --More-- now */ |
| 2834 | if (ttyDisplay->toplin == TOPLINE_NEED_MORE) { |
| 2835 | more(); |
| 2836 | ttyDisplay->toplin = TOPLINE_NEED_MORE; /* more resets this */ |
| 2837 | tty_clear_nhwindow(WIN_MESSAGE); |
| 2838 | nhassert(ttyDisplay->toplin == TOPLINE_EMPTY); |
| 2839 | } |
| 2840 | /* normally <ESC> means skip further messages, but in this case |
| 2841 | it means cancel the current prompt; any other messages should |
| 2842 | continue to be output normally */ |
| 2843 | wins[WIN_MESSAGE]->flags &= ~WIN_CANCELLED; |
| 2844 | ttyDisplay->dismiss_more = 0; |
| 2845 | |
| 2846 | return ((how == PICK_ONE && morc == let) || morc == '\033') ? morc : '\0'; |
| 2847 | } |
| 2848 | |
| 2849 | win_request_info * |
| 2850 | tty_ctrl_nhwindow( |
nothing calls this directly
no test coverage detected