481

I start telnet by telnet host port. How do I stop it in Windows? Shockingly, Ctrl+C doesn't work.

3
  • 19
    Welcome to the trenches, nothing is "shocking" on Windows.
    – Pacerier
    Jul 3, 2015 at 4:15
  • 5
    @Pacerier telnet predates Windows, and Microsoft had excellent UI standards in the 80s and 90s. Jan 7, 2016 at 13:07
  • 8
    The reason Ctrl+C doesn't interrupt or suspend the connection is that an interrupt signal or a Ctrl+C often needs to be passed through to the remote end (so you can break programs there, if you're working on a remote shell), which wouldn't be possible if the telnet client intercepted it for its own purposes. Jan 12, 2017 at 23:15

6 Answers 6

701

It should have printed something along the lines of:

Escape character is '^]'.

Since ^X is CtrlX, try Ctrl] for ^].

You should then enter the telnet console, where you can enter quit to leave telnet.

33
  • 37
    on Windows, run telnet with out arguments to see what the escape character is. On some localized Windows versions where ] is only available with Alt Gr key, the key combination is Ctrl++.
    – mihi
    Oct 11, 2012 at 18:24
  • 44
    As far as I remember Ctrl+5 was equivalent with ^] on my (Norwegian) keyboard.
    – hlovdal
    Oct 12, 2012 at 8:34
  • 8
    Ctrl+¨ on Windows 7 and sv/fi layout.
    – mkataja
    Nov 3, 2013 at 0:11
  • 42
    On Ubuntu Ctrl + ], quit worked for me Jun 19, 2014 at 20:31
  • 18
    On my swedish keyboard it was Ctrl+¨
    – Krycke
    Mar 16, 2016 at 11:05
164

Type quit to exit telnet in windows.

8
  • 11
    Worked on MacOS X as well ;)
    – karlingen
    Jun 13, 2014 at 7:13
  • 7
    Also works in Linux.
    – 에이바
    Jan 30, 2015 at 18:45
  • From @Isaac: This also works on Windows 8.1.
    – fixer1234
    Apr 20, 2015 at 5:21
  • 15
    @Alexander you have to press Ctrl + ] and only then when telnet> prompt appears enter quit.
    – Gacha
    Dec 29, 2015 at 11:58
  • 5
    For some reason I get Microsoft Telnet> ^] Invalid Command. type ?/help for help but quit works. Thanks. Feb 9, 2016 at 0:41
63

The ^] means ctrl + right bracket. As strange as that is, it works. You'll be taken to the telnet prompt, where you can type quit or simply q.

On international keyboards the ] character is often not a single key, and needs to be replaced with some other key. The correct key is typically the key to the right of P or the next key after that.

Here's a list based on comments below:

  • Norwegian: ctrl + å
  • Danish, Finnish, and Swedish: ctrl + ¨ [added by Fredrik C]
  • French: ctrl + 6
  • German, Turkish: ctrl + ü
  • Swiss: ctrl + ¨
  • Hungarian: ctrl + 5 or ctrl + ú
  • Portuguese: ctrl + ´
  • Dutch, Belgian: ctrl + $
  • Canadian French: ctrl + ç
  • Italian: ctrl + +

Quote from @jtbandes answer here: https://superuser.com/a/427/192525 All creds to him.

PS: Answer reproduced here for your convenience, since google took me to this question first, and none of the other answers here was sufficient for my case. The question How to send the escape character on OS X terminal? could be seen as a duplicate (more generic version) of this question, since the OP's problems are basically the same.

13
  • 2
    French keyboard here on Win7 with a remote session on a Ubuntu 17.10 VM via Putty. I got the telnet prompt back with ctrl+5 not ctrl+6 Dec 12, 2017 at 13:19
  • 8
    For my German keyboard it's actually ctr++, not ctr+ü Feb 22, 2018 at 12:56
  • 4
    If you use Turkish Q on ubuntu CTRL + 5 is the key Oct 12, 2018 at 9:03
  • 2
    If you use latin american spanish CTRL+5 is the key too Jul 9, 2019 at 2:03
  • 1
    @D.Pardal The ^ in ^] just refers to the CTRL button, since it is marked by an ^ on the keyboard. So it just means CTRL + ] so telnet is right that the character itself is just ]
    – Magne
    Sep 21, 2019 at 12:33
10

On debian 9, typing :

Ctrl + $

Allows you to show the prompt from telnet, then only type :

q

To exit

2
  • 1
    It works on Ubuntu as well :)
    – SebMa
    Mar 28, 2023 at 16:06
  • The only combinaison OK for me (French keyboard)
    – JCH77
    Apr 20, 2023 at 23:11
2

all previous answers correct but for this worked:

Ctrl + ]

then I typed

quit
1

"How do I stop it in Windows?"

I miss the good old ALT + 29 ¹ on the numeric keypad. And then "quit". This works since DOS and (should) work across all KB layouts in windows. Tested 2023 with a Greek Island layout on windows 11.

¹ With ALT + number on numpad you get all ASCII codes.

^A is 1, ^B is 2 … ^[ is 27 (as ESC) and finally ^] is 29

ALT + 64 -> @

ALT + 64 -> A

1
  • Upvoted: Tested, worked on a Simplified Chinese keyboard in Windows 11.
    – Geno Chen
    Nov 21, 2023 at 3:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .