Git Product home page Git Product logo

pysshlm's People

Stargazers

 avatar

Watchers

 avatar  avatar

pysshlm's Issues

arrow navigation

Left and right arrow should move the insert cursor during line mode

crash when pty.read (size=1024) ends/appears to end in the middle of utf-8 char (?)

The issue title appears to be a fair description of what caused the error.

Sample:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/npayne/.local/lib/python2.7/site-packages/pysshlm-1.0.0-py2.7.egg/pysshlm/thin_wrapper.py", line 251, in flow_output
    s = self.pty.read (size=1024)
  File "build/bdist.linux-x86_64/egg/ptyprocess/ptyprocess.py", line 812, in read
    return self.decoder.decode(b, final=False)
  File "/usr/local/lib/python2.7/codecs.py", line 296, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe2 in position 98: invalid continuation byte

This occurred when attempting to cat an sqlite3 .db file, so it's unlikely that it was a case of landing in the middle of a UTF8 sequence, actually it's unclear if landing in the middle would fail or if the reader buffers full UTF8 chars.

At any rate, in this case, the reader was fooled by the .db file's binary data.

Actions needed:

  • a review of the flow_output() function's behaviour when reaching the middle of a UTF8 sequence

  • immediately fix the fact that an exception in flow_output() throws the whole terminal into an unrecoverable state (catch the exception?) 72378eac19fca7ec2e2cc13723adc5044d244e5c

The problem file is attached as .txt since github filters .db. Rename it upon download if you like.

problem_file.txt

thanks :)

Saw your comment, # god bless the author of blessed for their work in setting up sequence handling

So happy to help! I have little time to improve it (I hope to add Windows support in cmd.exe someday, for example), I see some input-related issues like #2 maybe I can help with, best wishes and enjoy coding!

"emacs-mode" navigation

C-a = "home"
C-b = "left"
C-f = "right"
C-e = "end"
C-p = "up"
C-n = "down"
C-k = "kill rest of line"
C-y = "paste from kill"
M-b = "left 1 word"
M-f = "right 1 word"
M-d = "delete 1 word right"
M-backspace = "delete 1 word left"

shift + insert only sends first char of clipboard

This is a really strange issue... Easy to test, hard to determine the cause upon first thinking about it. All chars not consumed should be waiting in a buffer for the next loop-round of flow_input()...?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.