You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to paste something into widget Line Edit using [ctrl] + [insert], the widget didnot show all the contents.
I digged into this situation and find that it is possibly because of this file [TermTk/TTkCore/TTkTerm/readinputlinux.py].
I tried to fix this problem by changing some of the code as below:
`
class ReadInput():
__slots__ = ('_readPipe','_attr', '_closeFlag')
def __init__(self):
self._readPipe = os.pipe()
self._attr = termios.tcgetattr(sys.stdin)
tty.setcbreak(sys.stdin)
self._closeFlag = False
def close(self):
termios.tcsetattr(sys.stdin, termios.TCSANOW, self._attr)
# os.write(self._readPipe[1], b'quit')
os.write(self._readPipe[1], b'quit')
self._closeFlag = True
def cont(self):
tty.setcbreak(sys.stdin)
def read(self):
while sys.stdin.readable() and self._closeFlag == False:
stdinRead = sys.stdin.read(1)
if self._closeFlag == True:
break
if stdinRead == "\033":
_fl = fcntl.fcntl(sys.stdin, fcntl.F_GETFL)
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, _fl | os.O_NONBLOCK) # Set the input as NONBLOCK to read the full sequence
stdinRead += sys.stdin.read(20) # Check if the stream start with an escape sequence
if stdinRead.startswith("\033[<"): # Clear the buffer if this is a mouse code
sys.stdin.read(0x40)
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, _fl)
return stdinRead
`
Hope that will work.
The text was updated successfully, but these errors were encountered:
Yes this is a feature I haven't properly implemented,
my input routine need definitely some tweaking,
the reason I use a select is to not make it blocking so I can close it through the readpipe.
I'll try to fix it as soon as I can,
thanks
When I tried to paste something into widget Line Edit using [ctrl] + [insert], the widget didnot show all the contents.
I digged into this situation and find that it is possibly because of this file [TermTk/TTkCore/TTkTerm/readinputlinux.py].
I tried to fix this problem by changing some of the code as below:
`
`
Hope that will work.
The text was updated successfully, but these errors were encountered: