Skip to content

Commit

Permalink
debug: add command to clear the terminal in the $dbg prompt (#20625)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ddiidev committed Jan 23, 2024
1 parent 9a857c1 commit 5b0f508
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vlib/v/debug/debug.v
Expand Up @@ -7,6 +7,7 @@ import os
import math
import readline
import strings
import term

__global g_debugger = Debugger{}

Expand Down Expand Up @@ -37,6 +38,7 @@ mut:
'scope',
'unwatch',
'watch',
'clear',
]
}
}
Expand Down Expand Up @@ -117,6 +119,7 @@ fn (mut d Debugger) print_help() {
println(' scope\t\t\tshow the vars in the current scope')
println(' u, unwatch <var>\tunwatches a variable')
println(' w, watch <var>\twatches a variable')
println(' clear\tClears the terminal window.')
flush_println('')
}

Expand Down Expand Up @@ -271,6 +274,9 @@ pub fn (mut d Debugger) interact(info DebugContextInfo) ! {
}
}
}
'clear' {
term.erase_clear()
}
'' {
if is_ctrl {
flush_println('')
Expand Down

0 comments on commit 5b0f508

Please sign in to comment.