Does anyone know the escape codes to change the cursor style in PuTTY 64-bit under Windows? I can't find this documented. It's currently set to VT100 emulation (but could change if needed - PuTTY also supports VT400 if that would work...). There's a set-up option to specify the cursor style (underline or block and blink/noblink), but I want to change this using an escape code from the server. I need two cursor styles but am not really bothered what these are (but would prefer underline and block).
Last edited on
I was interested enough to search around... did you already hit this one?

Yes - it says it isn't possible when used with vi. I was hoping that just referred to vi and that PuTTY was capable in itself. But perhaps not.

In MS console VT100 emulation, you can have a blinking or static cursor (which would do) (using ESC[?12h Enable Cursor blinking, ESC[?12l Disable Cursor Blinking) but these don't work with PuTTY (probably some special MS escape codes!).

Is there a 'better' telnet client that allows things like this to be done? and please don't anyone mention the MS telnet client. That is brain-dead from birth!

No clue, Ived used putty for decades without caring much too look farther. But ... I would bet whatever cygwin has would behave more like the unix ones... ?
Well if all else fails - read the source code!!

Under VT100 emulation:

hide cursor                  ESC=0c
restore cursor as underline  ESC=1c
set cursor as block          ESC=2c


That documented source is rather nice, far too many source files for 3rd party libraries/apps expect the end-user to just KNOW things.
More like RTFC!
I know of more than a few 3rd party libraries/apps that need to be compiled to use have piss-poor documentation. Either within the source code or help file(s).

So RTFM/RTFC in far too many instances is much the same thing. :D
I think you misunderstand. PuTTY doesn't need to be compiled to be used. It is a telnet client and is downloaded as an installable - no compile required. It supports VT100 & VT400 escape codes (plus others). The issue was that I couldn't find documentation regarding the VT escape codes to use to change the cursor style. Plenty on moving the cursor etc etc but not on actually changing the cursor. Some said (as per Jonnin's link) that it couldn't be done. I thought I remembered doing it when I programmed for VT terminals many, many years ago - but I don't now have the old VT manuals. After a fruitless search, I finally got mad and pulled the source from PuTTY's web site and looked for the required escape codes. Hence I found the ones I documented above for future use.

The issue isn't really PuTTY's as they say they support the standards. It's finding the full complete escape code list for the standard. I found dozens of web references, but none had these required escape sequences. It would be nice if PuTTY help documentation detailed the escape codes used - but that would take time away from actually developing the product.
There's always MobaXterm as an all-singing, all-dancing alternative:

My workplace would like us to use it to log in to the big parallel-computing facilities - but so far I've stuck to the simplicity of PuTTY.
I like Putty. It works. It's simple. No issues. I just wish they'd have an appendix in the documentation that details the escape codes recognised in the various emulations supported.
I've never cared about terminals; no clue about "escape codes".

For connection, openssh is my choice, now in Windows too. However, for ad hoc connections PuTTY is great as you don't need to install it in order to use it.
"escape codes" are so called because the sequence starts with the ESC char (dec 27). These are used to control the appearance/placement of text/cursor etc. There are different classes of these codes. One of the most common being VT100 - based upon the codes used by the DEC VT100 terminal. An example is ESC[H to move the cursor to the upper left corner.

Each class of these codes can have over 50 definitions. Then there are the codes sent when special keys are pressed - eg pressing <left arrow> generates ESC[D.
Thanks for sharing this information

I'm kind of curious about what you're doing with this. In my world PuTTY has two uses, SSH and Serial, it's more of a shell than an application. It's basically a text based version of RDP for me. The idea of seeing it in another light has piqued my interest a bit.
Last edited on
It's used in this context as a simple telnet client - as the MS one is a load of c*** and bu******.

However, even in Serial mode, it will recognise the escape codes.
Last edited on
Topic archived. No new replies allowed.