mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
parent
ad8218a2ea
commit
e7eddad588
@ -103,7 +103,7 @@ function tty.stream:write(value)
|
||||
|
||||
local x, y = tty.getCursor()
|
||||
|
||||
local _, ei, delim = unicode.sub(window.output_buffer, 1, window.width):find("([\27\t\r\n\a])")
|
||||
local _, ei, delim = unicode.sub(window.output_buffer, 1, window.width):find("([\27\t\r\n\a\b\15])")
|
||||
local segment = ansi_print .. (ei and window.output_buffer:sub(1, ei - 1) or window.output_buffer)
|
||||
|
||||
if segment ~= "" then
|
||||
@ -132,9 +132,13 @@ function tty.stream:write(value)
|
||||
|
||||
if delim == "\t" then
|
||||
x = ((x-1) - ((x-1) % 8)) + 9
|
||||
elseif delim == "\r" or (delim == "\n" and not window.cr_last) then
|
||||
elseif delim == "\r" then
|
||||
x = 1
|
||||
elseif delim == "\n" then
|
||||
x = 1
|
||||
y = y + 1
|
||||
elseif delim == "\b" then
|
||||
x = x - 1
|
||||
elseif delim == "\a" and not beeped then
|
||||
computer.beep()
|
||||
beeped = true
|
||||
@ -143,7 +147,6 @@ function tty.stream:write(value)
|
||||
end
|
||||
|
||||
tty.setCursor(x, y)
|
||||
window.cr_last = delim == "\r"
|
||||
end
|
||||
return cursor.sy
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user