diff options
Diffstat (limited to 'lib-src/emacsclient.c')
| -rw-r--r-- | lib-src/emacsclient.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 0ae1f0bddea..5e1c2d61b89 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -638,6 +638,22 @@ decode_options (int argc, char **argv) | |||
| 638 | if (display && strlen (display) == 0) | 638 | if (display && strlen (display) == 0) |
| 639 | display = NULL; | 639 | display = NULL; |
| 640 | 640 | ||
| 641 | #ifdef WINDOWSNT | ||
| 642 | /* Emacs on Windows does not support GUI and console frames in the same | ||
| 643 | instance. So, it makes sense to treat the -t and -c options as | ||
| 644 | equivalent, and open a new frame regardless of whether the running | ||
| 645 | instance is GUI or console. Ideally, we would only set tty = 1 when | ||
| 646 | the instance is running in a console, but alas we don't know that. | ||
| 647 | The simplest workaround is to always ask for a tty frame, and let | ||
| 648 | server.el check whether it makes sense. */ | ||
| 649 | if (tty || !current_frame) | ||
| 650 | { | ||
| 651 | display = (const char *) ttyname; | ||
| 652 | current_frame = 0; | ||
| 653 | tty = 1; | ||
| 654 | } | ||
| 655 | #endif | ||
| 656 | |||
| 641 | /* If no display is available, new frames are tty frames. */ | 657 | /* If no display is available, new frames are tty frames. */ |
| 642 | if (!current_frame && !display) | 658 | if (!current_frame && !display) |
| 643 | tty = 1; | 659 | tty = 1; |
| @@ -654,14 +670,6 @@ decode_options (int argc, char **argv) | |||
| 654 | an empty string"); | 670 | an empty string"); |
| 655 | exit (EXIT_FAILURE); | 671 | exit (EXIT_FAILURE); |
| 656 | } | 672 | } |
| 657 | |||
| 658 | /* TTY frames not supported on Windows. Continue using GUI rather than | ||
| 659 | forcing the user to change their command-line. This is required since | ||
| 660 | tty is set above if certain options are given and $DISPLAY is not set, | ||
| 661 | which is not obvious to users. */ | ||
| 662 | if (tty) | ||
| 663 | tty = 0; | ||
| 664 | |||
| 665 | #endif /* WINDOWSNT */ | 673 | #endif /* WINDOWSNT */ |
| 666 | } | 674 | } |
| 667 | 675 | ||