mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-06-03 10:59:41 +00:00
Clear scrollback on hard reset
This commit is contained in:
@@ -733,6 +733,7 @@ class Terminal
|
||||
|
||||
# ESC c Full Reset (RIS).
|
||||
when "c"
|
||||
@clearScrollback()
|
||||
@reset()
|
||||
|
||||
# ESC E Next Line ( NEL is 0x85).
|
||||
@@ -1731,6 +1732,21 @@ class Terminal
|
||||
@resetVars()
|
||||
@refresh(true)
|
||||
|
||||
clearScrollback: ->
|
||||
# In case of real hard reset
|
||||
# Drop DOM history
|
||||
lines = document.querySelectorAll('.line')
|
||||
if lines.length > @rows
|
||||
for line in Array.prototype.slice.call(
|
||||
lines, 0, lines.length - @rows)
|
||||
line.remove()
|
||||
for group in document.querySelectorAll('.group:empty')
|
||||
group.remove()
|
||||
lines = document.querySelectorAll('.line')
|
||||
@children = Array.prototype.slice.call(
|
||||
lines, -@rows)
|
||||
|
||||
|
||||
# ESC H Tab Set (HTS is 0x88).
|
||||
tabSet: ->
|
||||
@tabs[@x] = true
|
||||
|
||||
Reference in New Issue
Block a user