зеркало из https://github.com/github/putty.git
Remove FLAG_STDERR_TTY.
It really had no need to be a global process flag at all: it's used to signal to uxcons.c that stderr_tty_init() ought to check whether stderr is a tty (in order to save its termios across interactive prompts and so forth). But the only _caller_ of stderr_tty_init is Unix Plink, which always sets that flag! So we already have a perfectly good system for signalling to uxcons.c that you'd like stderr_tty_init to do something: _whether you call it or not_.
This commit is contained in:
Родитель
dc59fcf8e3
Коммит
6e85d3fe60
14
unix/unix.h
14
unix/unix.h
|
@ -101,18 +101,6 @@ unsigned long getticks(void);
|
|||
#define WCHAR wchar_t
|
||||
#define BYTE unsigned char
|
||||
|
||||
/*
|
||||
* Unix-specific global flag
|
||||
*
|
||||
* FLAG_STDERR_TTY indicates that standard error might be a terminal and
|
||||
* might get its configuration munged, so anything trying to output plain
|
||||
* text (i.e. with newlines in it) will need to put it back into cooked
|
||||
* mode first. Applications setting this flag should also call
|
||||
* stderr_tty_init() before messing with any terminal modes, and can call
|
||||
* premsg() before outputting text to stderr and postmsg() afterwards.
|
||||
*/
|
||||
#define FLAG_STDERR_TTY 0x1000
|
||||
|
||||
#define PLATFORM_CLIPBOARDS(X) \
|
||||
X(CLIP_PRIMARY, "X11 primary selection") \
|
||||
X(CLIP_CLIPBOARD, "XDG clipboard") \
|
||||
|
@ -305,7 +293,7 @@ extern char *pty_osx_envrestore_prefix;
|
|||
|
||||
/* Things provided by uxcons.c */
|
||||
struct termios;
|
||||
void stderr_tty_init(void);
|
||||
void stderr_tty_init(void); /* call at startup if stderr might be a tty */
|
||||
void premsg(struct termios *);
|
||||
void postmsg(struct termios *);
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ static bool stderr_is_a_tty;
|
|||
void stderr_tty_init()
|
||||
{
|
||||
/* Ensure that if stderr is a tty, we can get it back to a sane state. */
|
||||
if ((flags & FLAG_STDERR_TTY) && isatty(STDERR_FILENO)) {
|
||||
if (isatty(STDERR_FILENO)) {
|
||||
stderr_is_a_tty = true;
|
||||
tcgetattr(STDERR_FILENO, &orig_termios_stderr);
|
||||
}
|
||||
|
|
|
@ -603,7 +603,7 @@ int main(int argc, char **argv)
|
|||
stderr_bs = BinarySink_UPCAST(&stderr_bcs);
|
||||
outgoingeof = EOF_NO;
|
||||
|
||||
flags = FLAG_STDERR_TTY;
|
||||
flags = 0;
|
||||
cmdline_tooltype |=
|
||||
(TOOLTYPE_HOST_ARG |
|
||||
TOOLTYPE_HOST_ARG_CAN_BE_SESSION |
|
||||
|
|
Загрузка…
Ссылка в новой задаче