I start telnet by telnet host port. How do I stop it in Windows? Shockingly, Ctrl+C doesn't work.
- 61,504
- 38
- 179
- 264
- 1
- 7
- 20
- 39
-
19Welcome to the trenches, nothing is "shocking" on Windows. – Pacerier Jul 03 '15 at 04:15
-
5@Pacerier `telnet` predates Windows, and Microsoft had excellent UI standards in the 80s and 90s. – Cees Timmerman Jan 07 '16 at 13:07
-
8The 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. – blubberdiblub Jan 12 '17 at 23:15
5 Answers
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.
-
37on 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 '12 at 18:24
-
43As far as I remember Ctrl+5 was equivalent with ^] on my (Norwegian) keyboard. – hlovdal Oct 12 '12 at 08:34
-
7
-
40
-
3Doesn't work. It says: `Microsoft Telnet> ^]` and next line shows: `Invalid Command. type ?/help for help` – Pacerier Jul 03 '15 at 04:19
-
2
-
From CMD write telnet "hostip/name" "portnumber" then do disconnect. Press down the CTRL key and another random key on the keyboard until you find the correct one. And then write "quit" press enter. – ColacX Sep 22 '15 at 13:06
-
I never noticed that before... amazing whats right in front of your face – WernerCD Sep 25 '15 at 15:13
-
It's CTRL+$ (i tested this on windows 10) This is the output from my console: Welcome to Microsoft Telnet Client Escape Character is 'CTRL+$' Microsoft Telnet> quit C:\WINDOWS\system32> – Kris Nobels Dec 14 '15 at 23:33
-
2
-
16
-
@Krycke The same for Swiss Keyboard, the key `]` must be used with `AltGr` but for that purpose, we just press the `Ctrl`+`¨` – рüффп Mar 22 '16 at 10:29
-
-
-
2On my Mac with Norwegian keyboard, `]` is `Alt` + `9`. Typing `Ctrl` + `Alt` + `9` yields `9` and is not recognised by telnet as escape character. I had to switch to U.S. input source under `Keyboard` --> `Input Sources` to be able to type `Ctrl` + `]`. – rlovtang May 04 '17 at 10:30
-
To add to rlovtang's answer: The ] character on US keyboard layout is what is marked as the ^¨ key on the norwegian keyboard. – Magne Sep 01 '17 at 08:15
-
1actually, I discovered that you don't have to switch keyboard layout. With the norwegian layout it's as easy as typing: `ctrl + å` as you can see in the quoted answer below. Solution in other keyboard language layouts is also listed there. – Magne Sep 01 '17 at 08:33
-
-
2
-
On danish keyboard for windows: As with @rlovtang suggestion of switching keyboard. Alt + Shift to switch keyboard language or select directly in the buttom right corner of the Task Bar. Then ctrl + ¨ (where ¨ results in ]) – Sonaten Oct 25 '18 at 11:27
-
1with german keyboard layout on macos `CTRL+OPTION+6` then type close and enter – muuvmuuv Jun 17 '19 at 12:00
-
-
-
2
-
On a Mac with German layout, type ctrl-option-6 (where option-6 gives `]`) to get into command mode, then type `quit` + return. – SuperTempel Oct 30 '20 at 09:40
-
-
1
-
this does NOT work all the time....the next answer `quit` does work all the time – uberrebu Nov 18 '21 at 03:39
-
-
-
I always forget about this! why is so different? :(:( thanks!! it wokrs on ubuntu too. – Rodrigo Oct 17 '22 at 20:19
-
Protip: Use On-screen keyboard to figure out where that bloody `]` is located with current keyboard layout :) – jgangso Dec 02 '22 at 10:18
-
11
-
7
-
-
-
-
14@Alexander you have to press `Ctrl + ]` and only then when `telnet>` prompt appears enter `quit`. – Gacha Dec 29 '15 at 11:58
-
5For some reason I get `Microsoft Telnet> ^] Invalid Command. type ?/help for help` but `quit` works. Thanks. – Charles Clayton Feb 09 '16 at 00:41
-
This applies to the telnet interpreter, and not to a running telnet connection, that was asked for – oo_dev Jul 24 '19 at 11:44
The
^]means ctrl + right bracket. As strange as that is, it works. You'll be taken to the telnet prompt, where you can typequitor simplyq.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.
- 726
- 5
- 9
-
2French 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 – Diego Tercero Dec 12 '17 at 13:19
-
7
-
4
-
2
-
Doesn't seem to work in Portuguese. (Windows 10). Also, telnet says the escape char is ']', not '^]'. – D. Pardal Jul 13 '19 at 10:23
-
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 '19 at 12:33
-
1Thank @GustavoAriasMéndez in Spanish keyboard using SSL terminal conected to unix, control + 5 works! – Hernaldo Gonzalez Oct 29 '19 at 16:54
-
-
On Linux (including WSL) you can run `showkey -a` to check the characters which a terminal application receives. You can then try to press various key combinations to find `^]`. See https://askubuntu.com/a/1366082/67132 – pabouk - Ukraine stay strong Sep 27 '21 at 14:56
-
-
If you use Czech layout, `Ctrl` + `Alt Gr` + `G` is the escape key. Note you can make `telnet` use any escape key you like, with the -e option, e.g. `-e ^F` for Ctrl+F key. – akwky Jan 12 '22 at 10:53
-
@dominikandreas Slightly of topic: On Linux (Ubuntu) I have to choose the combination Strg+AltGr+9 (Strg++ is mapped only to "+"). – Johann Klasek Jul 26 '22 at 17:58
-
On debian 9, typing :
Ctrl + $
Allows you to show the prompt from telnet, then only type :
q
To exit
- 201
- 3
- 6