Comments (18)
Works for me in gnome-terminal, what terminal are you using?
from rtv.
Not working in iterm2 for os x
from rtv.
Not working on xfce4-terminal 0.6.3
from rtv.
It actually works for me on a fresh install of xfce4-terminal 0.6.3. Try going to preferences -> compatability and check what the backspace key is set to. curses expects control-h (^h). My guess is that iterm2 has a similar issue, but I'm unable to check because I don't have a Mac.
From the curses documentation
"""Editing widget using the interior of a window object.
Supports the following Emacs-like key bindings:
Ctrl-A Go to left edge of window.
Ctrl-B Cursor left, wrapping to previous line if appropriate.
Ctrl-D Delete character under cursor.
Ctrl-E Go to right edge (stripspaces off) or end of line (stripspaces on).
Ctrl-F Cursor right, wrapping to next line when appropriate.
Ctrl-G Terminate, returning the window contents.
Ctrl-H Delete character backward.
Ctrl-J Terminate if the window is 1 line, otherwise insert newline.
Ctrl-K If line is blank, delete it, otherwise clear to end of line.
Ctrl-L Refresh screen.
Ctrl-N Cursor down; move down one line.
Ctrl-O Insert a blank line at cursor location.
Ctrl-P Cursor up; move up one line.
Move operations do nothing if the cursor is at an edge where the movement
is not possible. The following synonyms are supported where possible:
KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
KEY_BACKSPACE = Ctrl-h
from rtv.
I can confirm it doesn't work on iTerm 2
from rtv.
I think iTerm 2 uses ^? as the backspace key (http://www.macfreek.nl/memory/Backspace_and_Delete_key_reversed#iTerm_.28Mac_OS_X_application.29)
from rtv.
So looking through the curses textpad source there are two supported keys for backspace
curses.ascii.BS
which is mapped to0x08
(^H)curses.KEY_BACKSPACE
which is mapped to0x107
It's seems very strange that curses.ascii.DEL
which is mapped to 0x7F
(^?) is not supported. From the link that you posted that seems to be the standard convention. Sure enough, when I type ctrl-v and press the backspace key, it prints ^? in my terminal.
from rtv.
I still don't understand exactly what's causing this, but I pushed a patch 7738211 to convert 0x7f
to a backspace. Please let me know if this fixes the problem for you.
from rtv.
I try on Windows but it didn't work,too. (Tested after the patch 7738211). And all the characters after ''Enter Subreddit: /r/" is invisible (maybe it's black!).
from rtv.
Sorry, I'm just beginner of curses. After typing the name of subreddit, how can I access it? ENTER key didn't work.
from rtv.
What do you mean by it is invisible? As in, if the text was "/r/python" it shows as "/r/ ython"?
from rtv.
No, I mean I can see the cursor change the position but I can't see the text I typed!
Here is the shot after I typed 'python', the small red rectangle is the position of cursors.
from rtv.
Hi @peterpans01, thanks for the heads up.
Did you have to do anything special to get this to work in Windows? According to https://docs.python.org/3.3/howto/curses.html, curses is not included in the Windows version of Python. I'm honestly surprised that this is working for you at all.
My guess is that whatever curses build that you're using has different behavior for some functions, namely this one https://docs.python.org/2/library/curses.html#curses.window.addch. I'll try it out on my Windows box when I get home today.
from rtv.
Just informing that it works fine on xterm.
from rtv.
Hi @michael-lazar, it's not so special. I just need to install curses in windows and it's works. π You can try to intall curses here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses. I'm still looking for a solution for that.
from rtv.
Is it possible that rtv could install curses automatically if an installation is not found?
from rtv.
I confirm that backspace works in Windows 7 and I can fix the errors I show above.
from rtv.
Resolved in #31. Thanks again for looking into this @peterpans01. Once things have settled down a bit, I'll add a section in the README with instructions for installing curses on Windows.
from rtv.
Related Issues (20)
- add Twitch mime parser HOT 5
- Crash when hitting G on empty thread HOT 1
- RTV development is shutting down HOT 30
- Offering to help with the project HOT 1
- ConnectionError upon first launch
- no confirmation on exit HOT 1
- Program exited with status 127 HOT 1
- When you set $RTV_BROWSER variable to a program with options like "mybrowser -u" it basicly doesn't work HOT 1
- [1.2.7] Where is the configuration option to toggle whether to open web browser links in a new tab or a new window?
- Not being able to view remote image url via iTerm2's imgcat HOT 6
- How do I change it that rtv uses leafpad instead of nano as its default text editor?
- Save option for posts.
- Option to edit a posted comment.
- Where does rtv store the credentials or session/cookie file so I could just take a rtv install to another OS/new install and donβt have to reopen Firefox for allowing the app access?
- Version 1.27.0_1 (from brew) crashed when opening url HOT 5
- Fix incase mpv is not opening anymore
- When pressing < o > key on a reddit post rtv crashes, "Can't pickle local object" HOT 1
- Crash while trying to sign in HOT 1
- Crash while trying to open a submission link HOT 2
- Archiving Github Repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtv.