Is it possible to clear the command window of gdb? I mean, is there a command in gdb that do the same (for the command windows) as the clear
command in a bash terminal?
How clear gdb command screen?
Hit Control + L
. Works for me in Linux and Mac OS X as well with recent versions of GDB.
@Huron you must be using some insane environment. –
Scevor
@H2CO3 also doesn't work under OSX/xterm, fairly vanilla setup –
Firstling
@H2CO3: I assumed you know that. I just thought I'd mention this for other readers. –
Margarettmargaretta
@JohnTortugo: Using Ctrl-L to clear the screen is a feature of the shell, not of the terminal emulator. (The shell has to know what control sequence to use; that's what
terminfo
is for.) –
Marginal Control L doesn't clear the screen. It shifts the screen up so that the last line is at the top. The answer from pd2q that has "shell clear" actually clears the screen. –
Lota
Depending on the environment you can try this key combination: Ctrl+L. That is: hold down the Control key, and type the L key.
But this may not work in all environments. You can also try the following: in gdb you can execute shell commands using shell
: use this to call out to the shell to clear the terminal:
shell clear
this returns 'XTERM': unknown terminal type. –
Huron
@Huron are you running gdb in an xterm or e.g. through ssh? –
Firstling
@Huron I can't test that, but it sounds like you need to tweak your
TERM
setting –
Firstling @Huron play around w/ TERM settings under gnome-term and you should be able to use it there as well. –
Firstling
I'm using debian squeeze.Gdb 7.01 –
Huron
shell reset
if your terminal is really hosed. –
Solanaceous You are right this one always works for me. Ctrl + L may fail some times. e.g. clearing TUI outputs. –
Perfume
@Firstling I'm using gbd in Windows 7 cmd (via MinGW). ctrl+ L is not clearing the screen. Any idea how I should to it on windows ? –
Barbur
@JasonKrs,
shell cls
will do the job. On MinGW gdb seems to have cmd.exe as shell. –
Norrie Can I do it in such a way that my registers and assembly TUI layouts are still visible? I only need to clear the cmd part of gdb. Ah, found it, leaving this comment here as the question might assume my use case as well (when looking at the title). #42283455 –
Anticlockwise
If you downloaded gdb from MingW your cmd.exe seems to be known as shell, therefore to clear the command screen you need to use this command instead
shell cls
© 2022 - 2024 — McMap. All rights reserved.
clear
command. Hence, a good habit to get into. ;-) – Margarettmargaretta