Gary Johnson wrote: > > > Does anyone know what codes need to be sent to at > > > least xterm to have the cursor shape/color restored on vim exit? > > > > As far as I know it's impossible, there doesn't appear a way to obtain > > the cursor color that is in use when Vim is started. > > (I'm catching up on some old unread list e-mail.) > > According to the ctlseqs.ms document that came with xterm-165: > > > Operating System Controls > OSC Ps ; Pt ST > OSC Ps ; Pt BEL > Set Text Parameters. For colors and font, if Pt is a > "?", the control sequence elicits a response which con- > sists of the control sequence which would set the > corresponding value. .... > ... > Ps = 1 2 -> Change colors starting with text cursor to > Pt > > > I executed this command at a Linux shell prompt, > > echo -e '\033]12;?\007' ; read x > > and got the following response: > > ^[]12;rgb:ffff/ffff/ffff^G > > After setting the cursor to red and repeating the command, I got > this: > > ^[]12;rgb:ffff/0000/0000^G > > So, xterm does have the mechanism to obtain the cursor color when > vim is started. I just don't know how to obtain the terminal's > response from within vim and don't have the time to experiment > further at the moment. I did discover, though, that you can echo > back the color in that same format, so no parsing of the terminal > response would be necessary.
Interesting, this must have been added recently. I wonder what triggers the "rgb:" response. It doesn't state somewhere why this happens instead of the "ordinary" color numbers. Perhaps because xterm was compiled with more than 16 colors? -- hundred-and-one symptoms of being an internet addict: 42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth. /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://www.ICCF.nl ///
