^x for special chars

This commit is contained in:
Mewrry the Kitty 2026-02-07 10:18:34 -06:00
parent dda10f494f
commit 71e504e273

View file

@ -173,10 +173,13 @@ def do_client
end
while (char = STDIN.noecho(&:getch))
exit unless char != "\x03" # ^C
exit unless char != "\x04" # ^D
next unless char.ord >= 0x20 # Non printing
next unless char.ord != 0x7F # DEL (Non print)
if char.ord < 0x20 # Non printing
char = '^'+(char.ord + 0x40).chr
elsif char.ord == 0x7F # DEL (Non print)
char = '^?'
end
next unless
socket.puts "#{VERSION}|#{char}"
end
ensure