Added backspace compatability.
This commit is contained in:
10
rtv/utils.py
10
rtv/utils.py
@@ -2,9 +2,9 @@ import os
|
|||||||
import curses
|
import curses
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
from curses import textpad
|
|
||||||
from contextlib import contextmanager
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from curses import textpad, ascii
|
||||||
|
from contextlib import contextmanager
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from types import MethodType
|
from types import MethodType
|
||||||
|
|
||||||
@@ -73,8 +73,14 @@ def text_input(window):
|
|||||||
|
|
||||||
def validate(ch):
|
def validate(ch):
|
||||||
"Filters characters for special key sequences"
|
"Filters characters for special key sequences"
|
||||||
|
|
||||||
if ch == ESCAPE:
|
if ch == ESCAPE:
|
||||||
raise EscapePressed
|
raise EscapePressed
|
||||||
|
|
||||||
|
# Fix backspace for iterm
|
||||||
|
if ch == ascii.DEL:
|
||||||
|
ch = curses.KEY_BACKSPACE
|
||||||
|
|
||||||
return ch
|
return ch
|
||||||
|
|
||||||
# Wrapping in an exception block so that we can distinguish when the user
|
# Wrapping in an exception block so that we can distinguish when the user
|
||||||
|
|||||||
Reference in New Issue
Block a user