Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing to navigate through code by ctrl+arrows #201

Closed
ikanobori opened this issue Jul 4, 2014 · 19 comments
Closed

Allowing to navigate through code by ctrl+arrows #201

ikanobori opened this issue Jul 4, 2014 · 19 comments
Labels

Comments

@ikanobori
Copy link
Contributor

Normally, it's possible to navigate through text in terminal (and almost any place) by using ctrl+left/right arrow. In BPython that doesn't work.


@ikanobori
Copy link
Contributor Author

@ikanobori
Copy link
Contributor Author

@thomasballinger, ctrl-left and ctrl-right do not seem to work for me. On OS X 10.9, I get D and C respectively instead with bpython-curtsies. With plain bpython, those key combinations don't do anything at all.


Original Comment By: Steven Myint

@ikanobori
Copy link
Contributor Author

bpython-curtsies (now in trunk, no release yet) has ctrl-left, ctrl-right, meta-b and meta-f.

demo


Original Comment By:

@ikanobori
Copy link
Contributor Author

Issue #195 was marked as a duplicate of this issue.


Original Comment By: Sebastian Ramacher

@ikanobori
Copy link
Contributor Author

Ah, I see. So you're talking about readline's M-b and M-f (backward-word and forward-word).


Original Comment By: Sebastian Ramacher

@ikanobori
Copy link
Contributor Author

You can jump until the next underline too. For example my_long_mehtod_name: to reach the typo you would need a lot of key pressings without ctrl+arrow. In Java IDEs, for instance, this behavior is tweaked to work well with camelCase name convention. It's a lot useful when you get used to.


Original Comment By: Anonymous

@ikanobori
Copy link
Contributor Author

To jump a word at a time.


Original Comment By: Anonymous

@ikanobori
Copy link
Contributor Author

Maybe I'm just missing something but why would you want to navigate with Ctrl+Left/Right if you can just navigate with Left/Right?


Original Comment By: Sebastian Ramacher

@myint
Copy link
Contributor

myint commented Jul 25, 2014

This once again no longer works. I'm not sure what changed, but it still works fine in bash so I'm guessing something changed in bpython-curtsies. I am getting 5D for control-left and 5C for control-right.

@thomasballinger
Copy link
Member

Thanks @myint. Would you either 1) update curtsies and try the keys with python -m curtsies.events, or 2) try ctrl-v control-left in bash and post what you get?

I'm about to change over to explicitly named keys in bpython-curtsies instead of writing out the actual byte sequences, which should mean some improvement to this process - we'l be able to add missing key combinations to bpython-curtsies to add missing keys to bpython.

@myint
Copy link
Contributor

myint commented Jul 25, 2014

keylog.txt:

b'\x1b[1;5D' is called control-left
b'\x1b[1;5C' is called control-right

Thanks

myint referenced this issue in bpython/curtsies Jul 27, 2014
@thomasballinger
Copy link
Member

This is probably working now, but I can't test it.

@myint
Copy link
Contributor

myint commented Jul 27, 2014

Yeah, it works. Thanks.

@myint
Copy link
Contributor

myint commented Jul 27, 2014

Actually, it did work several hours ago. But I just tried upgrading both bpython and curtsies to master and now only control-left works. control-right does nothing. Also control-u no longer deletes the line.

@myint
Copy link
Contributor

myint commented Jul 27, 2014

It looks like the source of the regression is something in bpython. Testing on another machine that I did not pip upgrade, I see that upgrading to the latest curtsies master works fine. It is only when I also upgrade bpython to the latest master that I see the above problem.

@thomasballinger
Copy link
Member

Just fixed control-u, thanks for catching that. Looking into control-right
now.

On Sun, Jul 27, 2014 at 1:34 PM, Steven Myint notifications@github.com
wrote:

Actually, it did work several hours ago
thomasballinger/curtsies@7f159e9#commitcomment-7165024.
But I just tried upgrading both bpython and curtsies to master and now
only control-left works. control-right does nothing. Also control-u no
longer deletes the line.


Reply to this email directly or view it on GitHub
#201 (comment).

@thomasballinger
Copy link
Member

Fixed control-right

On Sun, Jul 27, 2014 at 1:44 PM, Thomas Ballinger <thomasballinger@gmail.com

wrote:

Just fixed control-u, thanks for catching that. Looking into control-right
now.

On Sun, Jul 27, 2014 at 1:34 PM, Steven Myint notifications@github.com
wrote:

Actually, it did work several hours ago
thomasballinger/curtsies@7f159e9#commitcomment-7165024.
But I just tried upgrading both bpython and curtsies to master and now
only control-left works. control-right does nothing. Also control-u no
longer deletes the line.


Reply to this email directly or view it on GitHub
#201 (comment).

@myint
Copy link
Contributor

myint commented Jul 27, 2014

Thanks.

@nmtitov
Copy link

nmtitov commented Mar 7, 2015

Thank you very much for that fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants