$ lldb vim
(lldb) target create "vim"
Current executable set to 'vim' (x86_64).
(lldb) run
Process 16364 launched: '/usr/local/bin/vim' (x86_64)
Process 16364 stopped
* thread #1: tid = 0x4f71ea, 0x0000000100193d13 vim`may_req_bg_color + 99 at term.c:3429, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000100193d13 vim`may_req_bg_color + 99 at term.c:3429
3426 && p_ek
3427 # ifdef UNIX
3428 && isatty(1)
-> 3429 && isatty(read_cmd_fd)
3430 # endif
3431 && *T_RBG != NUL
3432 && !option_was_set((char_u *)"bg"))
(lldb)
Kent.
This diff fixes the crash, but i'm not sure it is correct way to fix the problem:
diff --git a/src/term.c b/src/term.c
index 0d684e0..9dace0b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3428,7 +3428,7 @@ may_req_bg_color()
&& isatty(1)
&& isatty(read_cmd_fd)
# endif
- && *T_RBG != NUL
+ && T_RBG != NUL && *T_RBG != NUL
&& !option_was_set((char_u *)"bg"))
{
2015-6-26(Fri) 00:03:57 UTC+9 Bram Moolenaar:
The OSC(Operating System Controls) can be terminated with a ST. Same as a BEL.
Please see this url.
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Controls
Actually, Tera Term[1] returns The Background color response as:
<Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}ST
This causes a problem. (Vim startup after displayed 'g')
So I was allowed to ST (0x9c or ESC\) the termination character of Background color response.
Please check an attached patch.
[1]: http://ttssh2.osdn.jp/index.html.en
--
Best regards,
Hirohito Higashi
2015-7-5(Sun) 20:30:03 UTC+9 Christian Brabandt:
> Hi Benjamin!
>
> On Sa, 04 Jul 2015, Benjamin Kellner wrote:
>
> > This change seems to be causing issues with transparent rxvt-unicode terminals when assigning background transparency in .Xresources
> >
> > Issue has been reported here:
> >
> > https://bbs.archlinux.org/viewtopic.php?pid=1542046
>
> Can you check, if 7.4.766 fixes the problem for you?
Perhaps, this problem is not resolved in 7.4.766.
Vim(7.4.766 or later) supported Background color response is:
ESC]11;rgb:rrrr/gggg/bbbbBEL
Or
ESC]11;rgb:rrrr/gggg/bbbbST
But, rxvt-unicode returns this, when alpha value is not 0xffff. [1]
ESC]11;rgba;aaaa/rrrr/gggg/bbbbST
I think this behavior is proprietary extension of rxvt-unicode.
And rxvt-unicode document says below:
http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.1.pod#ALPHA_CHANNEL_SUPPORT
> Please note that due to bugs in Xft, specifying alpha values might result in
> garbage being displayed when the X-server does not support the RENDER
> extension.
What do you think?
[1]: http://dist.schmorp.de/rxvt-unicode/rxvt-unicode-9.21.tar.bz2
command.C : 3341 (in function rxvt_term::process_color_seq())
--
Best regards,
Hirohito Higashi (a.k.a h_east)
2015-7-7(Tue) 8:20:43 UTC+9 Anatol Pomozov:
> Is HEAD vim revision still broken? Could developers loos at this bug? Many Arch developers report this issue and we would like to release working version of vim.
I think that is no need to correspond to the "rgba:".
But, Vim is not good to output garbage being displayed which could not be interpreted the "Background color response".
So, I wrote a patch.
This patch is suppress to output garbage being displayed, when unknown background color response received. (e.g. "11;rgba:aaaa/rrrr/gggg/bbbb")
Please confirm this.
2015-7-8(Wed) 2:08:03 UTC+9 Bram Moolenaar:
No problem. Because it checked in src/term.c:L4414.
(Note: Line number is the after applying my patch)
4413 else if (*T_RBG != NUL
4414 && len >= 5 - (tp[0] == CSI)
4415 && argp[0] == '1' && argp[1] == '1' && argp[2] == ';')
4416 {
>
>
> > + j = 2 - (tp[0] == CSI);
> > + for (i = j; i < len; ++i)
> > + if (tp[i] == '\007'
> > + || (tp[0] == CSI ? tp[i] == STERM
> > + : i + 1 < len && tp[i] == ESC && tp[i + 1] == '\\'))
> > + {
> > + LOG_TR("Received unknown RBG");
> > + key_name[0] = (int)KS_EXTRA;
> > + key_name[1] = (int)KE_IGNORE;
> > + slen = i + 1 + (tp[i] == ESC);
> > + break;
> > + }
> > +
> > + if (i == len)
> > + {
> > + LOG_TR("not enough characters for RB");
> > + return -1; /* not enough characters */
> > + }
> > + }
>
> If the terminating character is missing, or the specific terminal uses
> another character to terminate the sequence, then this will eat
> everything.
This patch discard only the following pattern. ('*' is any character string)
ESC]11;*BEL
ESC]11;*ESC\
CSI11;*BEL
CSI11;*ST
So, I think the problem is less likely to occur.
>
> It's probably better to check for the specific code returned. When we
> find another variant we can add it.
I dislike to accept it in each time the terminal emulator proprietary implementation.
Thanks.
2015-7-9(Thu) 4:55:17 UTC+9 Bram Moolenaar:
Sorry. I have big mistake.
Patch 7.4.757 has confused the CSI(0x9b) and OSC(0x9d).
And, I did not notice it.
Please wait for a few days, because I refactor the term.c.
Thanks
2015-7-9(Thu) 10:47:12 UTC+9 h_east:
Done.
Changed contents:
- Defined the OSC in the same way as CSI, DCS.
- CSI, OSC and DCS check process was clearly separated.
Please confirm again.
BTW...
> > But when we get ESC]11; and then no BEL or ESC\ follows, we never get
> > out of this loop, we run into the "not enough characters" part forever.
This problem is also in the process of the current of CSI and DCS.
Find and check for below string in term.c
"Not enough characters for CRV"
"not enough characters for XT"
2015-7-9(Thu) 18:30:55 UTC+9 Bram Moolenaar:
Sure.
This matter is corresponding later.
I updated a patch. (BELL termination check were missing for RBG)
And I received a review from Hayaki Saito.
He says:
- 8-bit response can not received. (Contains mouse input)
- may_req_bg_color() call timing is too early. Should Called after t_CRV response received and switch to 8-bit mode.
The findings, I would try to correspond to the weekend.
These are the issues from before.
So, it might be good to include rbg_fix5.patch first :-)
Thanks.
--
Best regards,
Hirohito Higashi (a.k.a h_east)