Skip to content

Commit e42a6d2

Browse files
committed
patch 8.0.1295: cannot automatically get a server name in a terminal
Problem: Cannot automatically get a server name in a terminal. Solution: Add the --enable-autoservername flag to configure. (Cimbali, closes #2317)
1 parent 2f27aab commit e42a6d2

10 files changed

Lines changed: 63 additions & 4 deletions

File tree

runtime/doc/eval.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8820,6 +8820,7 @@ amiga Amiga version of Vim.
88208820
arabic Compiled with Arabic support |Arabic|.
88218821
arp Compiled with ARP support (Amiga).
88228822
autocmd Compiled with autocommand support. |autocommand|
8823+
autoservername Automatically enable |clientserver|
88238824
balloon_eval Compiled with |balloon-eval| support.
88248825
balloon_multiline GUI supports multiline balloons.
88258826
beos BeOS version of Vim.

runtime/doc/various.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ g8 Print the hex values of the bytes used in the
309309
*+ARP* Amiga only: ARP support included
310310
B *+arabic* |Arabic| language support
311311
N *+autocmd* |:autocmd|, automatic commands
312+
H *+autoservername* Automatically enable |clientserver|
312313
m *+balloon_eval* |balloon-eval| support. Included when compiling with
313314
supported GUI (Motif, GTK, GUI) and either
314315
Netbeans/Sun Workshop integration or |+eval| feature.

src/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ CClink = $(CC)
570570
# This disables the dialog that asks you if you want to save files or not.
571571
#CONF_OPT_XSMP = --disable-xsmp-interact
572572

573+
# If you want to always automatically add a servername, also in the terminal.
574+
#CONF_OPT_AUTOSERVE = --enable-autoservername
575+
573576
# COMPILER - Name of the compiler {{{1
574577
# The default from configure will mostly be fine, no need to change this, just
575578
# an example. If a compiler is defined here, configure will use it rather than
@@ -1866,7 +1869,7 @@ config auto/config.mk: auto/configure config.mk.in config.h.in
18661869
CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
18671870
LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \
18681871
./configure $(CONF_OPT_GUI) $(CONF_OPT_X) $(CONF_OPT_XSMP) \
1869-
$(CONF_OPT_DARWIN) $(CONF_OPT_FAIL) \
1872+
$(CONF_OPT_AUTOSERVE) $(CONF_OPT_DARWIN) $(CONF_OPT_FAIL) \
18701873
$(CONF_OPT_PERL) $(CONF_OPT_PYTHON) $(CONF_OPT_PYTHON3) \
18711874
$(CONF_OPT_TCL) $(CONF_OPT_RUBY) $(CONF_OPT_NLS) \
18721875
$(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \

src/auto/configure

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ enable_workshop
817817
enable_netbeans
818818
enable_channel
819819
enable_terminal
820+
enable_autoservername
820821
enable_multibyte
821822
enable_hangulinput
822823
enable_xim
@@ -1495,6 +1496,7 @@ Optional Features:
14951496
--disable-netbeans Disable NetBeans integration support.
14961497
--disable-channel Disable process communication support.
14971498
--enable-terminal Enable terminal emulation support.
1499+
--enable-autoservername Automatically define servername at vim startup.
14981500
--enable-multibyte Include multibyte editing support.
14991501
--enable-hangulinput Include Hangul input support.
15001502
--enable-xim Include XIM input support.
@@ -7516,6 +7518,22 @@ if test "$enable_terminal" = "yes"; then
75167518

75177519
fi
75187520

7521+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-autoservername argument" >&5
7522+
$as_echo_n "checking --enable-autoservername argument... " >&6; }
7523+
# Check whether --enable-autoservername was given.
7524+
if test "${enable_autoservername+set}" = set; then :
7525+
enableval=$enable_autoservername;
7526+
else
7527+
enable_autoservername="no"
7528+
fi
7529+
7530+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_autoservername" >&5
7531+
$as_echo "$enable_autoservername" >&6; }
7532+
if test "$enable_autoservername" = "yes"; then
7533+
$as_echo "#define FEAT_AUTOSERVERNAME 1" >>confdefs.h
7534+
7535+
fi
7536+
75197537
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-multibyte argument" >&5
75207538
$as_echo_n "checking --enable-multibyte argument... " >&6; }
75217539
# Check whether --enable-multibyte was given.

src/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@
384384
/* Define if you want to include multibyte support. */
385385
#undef FEAT_MBYTE
386386

387+
/* Define if you want to always define a server name at vim startup. */
388+
#undef FEAT_AUTOSERVERNAME
389+
387390
/* Define if you want to include fontset support. */
388391
#undef FEAT_XFONTSET
389392

src/configure.ac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,15 @@ if test "$enable_terminal" = "yes"; then
20662066
AC_SUBST(TERM_OBJ)
20672067
fi
20682068

2069+
AC_MSG_CHECKING(--enable-autoservername argument)
2070+
AC_ARG_ENABLE(autoservername,
2071+
[ --enable-autoservername Automatically define servername at vim startup.], ,
2072+
[enable_autoservername="no"])
2073+
AC_MSG_RESULT($enable_autoservername)
2074+
if test "$enable_autoservername" = "yes"; then
2075+
AC_DEFINE(FEAT_AUTOSERVERNAME)
2076+
fi
2077+
20692078
AC_MSG_CHECKING(--enable-multibyte argument)
20702079
AC_ARG_ENABLE(multibyte,
20712080
[ --enable-multibyte Include multibyte editing support.], ,

src/evalfunc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5580,6 +5580,9 @@ f_has(typval_T *argvars, typval_T *rettv)
55805580
#ifdef FEAT_AUTOCMD
55815581
"autocmd",
55825582
#endif
5583+
#ifdef FEAT_AUTOSERVERNAME
5584+
"autoservername",
5585+
#endif
55835586
#ifdef FEAT_BEVAL
55845587
"balloon_eval",
55855588
# ifndef FEAT_GUI_W32 /* other GUIs always have multiline balloons */

src/feature.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,14 @@
11671167
# define FEAT_CLIENTSERVER
11681168
#endif
11691169

1170+
/*
1171+
* +autoservername Automatically generate a servername for clientserver
1172+
* when --servername is not passed on the command line.
1173+
*/
1174+
#if defined(FEAT_CLIENTSERVER) && !defined(FEAT_AUTOSERVERNAME)
1175+
/* # define FEAT_AUTOSERVERNAME */
1176+
#endif
1177+
11701178
/*
11711179
* +termresponse send t_RV to obtain terminal response. Used for xterm
11721180
* to check if mouse dragging can be used and if term

src/main.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,12 +3673,18 @@ prepare_server(mparm_T *parmp)
36733673
/*
36743674
* Register for remote command execution with :serversend and --remote
36753675
* unless there was a -X or a --servername '' on the command line.
3676-
* Only register nongui-vim's with an explicit --servername argument.
3676+
* Only register nongui-vim's with an explicit --servername argument,
3677+
* or when compiling with autoservername.
36773678
* When running as root --servername is also required.
36783679
*/
36793680
if (X_DISPLAY != NULL && parmp->servername != NULL && (
3680-
# ifdef FEAT_GUI
3681-
(gui.in_use
3681+
# if defined(FEAT_AUTOSERVERNAME) || defined(FEAT_GUI)
3682+
(
3683+
# if defined(FEAT_AUTOSERVERNAME)
3684+
1
3685+
# else
3686+
gui.in_use
3687+
# endif
36823688
# ifdef UNIX
36833689
&& getuid() != ROOT_UID
36843690
# endif

src/version.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ static char *(features[]) =
8383
#else
8484
"-autocmd",
8585
#endif
86+
#ifdef FEAT_AUTOSERVERNAME
87+
"+autoservername",
88+
#else
89+
"-autoservername",
90+
#endif
8691
#ifdef FEAT_BEVAL
8792
"+balloon_eval",
8893
#else
@@ -761,6 +766,8 @@ static char *(features[]) =
761766

762767
static int included_patches[] =
763768
{ /* Add new patch number below this line */
769+
/**/
770+
1295,
764771
/**/
765772
1294,
766773
/**/

0 commit comments

Comments
 (0)