After starting cmd.exe on japanese windows, the title string is 「コマンドプロンプト」. 
Vim break it while executing commands. And I noticed that vim restoreing broken 
title string.

g_szOrigTitle is ANSI encoding. But vim call mch_settitle which is depend on 
current encoding.

diff -r e861ee614a3a src/os_mswin.c
--- a/src/os_mswin.c    Wed Sep 24 10:58:20 2014 +0900
+++ b/src/os_mswin.c    Fri Sep 26 15:17:59 2014 +0900
@@ -344,7 +344,7 @@
     int which)
 {
 #ifndef FEAT_GUI_MSWIN
-    mch_settitle((which & 1) ? g_szOrigTitle : NULL, NULL);
+    SetConsoleTitle(g_szOrigTitle);
 #endif
 }

diff -r e861ee614a3a src/os_win32.c
--- a/src/os_win32.c    Wed Sep 24 10:58:20 2014 +0900
+++ b/src/os_win32.c    Fri Sep 26 15:17:59 2014 +0900
@@ -4646,7 +4646,33 @@
     int        tmode = cur_tmode;
 #ifdef FEAT_TITLE
     char szShellTitle[512];
-
+# ifdef FEAT_MBYTE
+
+    /* Change the title to reflect that we are in a subshell. */
+    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+    {
+   WCHAR szShellTitle[512];
+   if (GetConsoleTitleW(szShellTitle, sizeof(szShellTitle)/sizeof(WCHAR) - 4) 
> 0)
+   {
+       if (cmd == NULL)
+       wcscat(szShellTitle, L" :sh");
+       else
+       {
+       WCHAR *wn = enc_to_utf16(cmd, NULL);
+       if (wn != NULL)
+       {
+           wcscat(szShellTitle, L" - !");
+           if ((wcslen(szShellTitle) + wcslen(wn) <
+               sizeof(szShellTitle)/sizeof(WCHAR)))
+           wcscat(szShellTitle, wn);
+           SetConsoleTitleW(szShellTitle);
+           vim_free(wn);
+           goto didset;
+       }
+       }
+   }
+    }
+#endif
     /* Change the title to reflect that we are in a subshell. */
     if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
     {
@@ -4658,8 +4684,9 @@
        if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
        strcat(szShellTitle, cmd);
    }
-   mch_settitle(szShellTitle, NULL);
+   SetConsoleTitle(szShellTitle);
     }
+didset:
 #endif

     out_flush();

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui