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

Add keyboard shortcut to scroll to where last command started output (feature request) #787

Closed
jasir opened this issue Jul 19, 2016 · 20 comments
Closed

Comments

@jasir
Copy link

@jasir jasir commented Jul 19, 2016

Hello,

I will try explain by use case:

When I run ie. cat longfile.txt, and many lines are outputed, when shortcut (ie. PgUp + Ctrl + Alt) is pressed, console scrolls to place, where I have written cat longfile.txt.

It can save lot of time, as I am often found myself pressing Ctrl + PgUp repeatedly and doing eye-scan looking for where output started.

Thanks for considering!

@pyhedgehog
Copy link

@pyhedgehog pyhedgehog commented Jul 22, 2016

Use less instead of cat.
But your request can be reformulated to more useful: Add escape-sequence to bookmark places to scroll to. You can add this sequence to $PS1 and use as requested.

@jasir
Copy link
Author

@jasir jasir commented Jul 23, 2016

cat was just an example. Your idea about bookmark is interesting, maybe implementation of this could be easier.

@pyhedgehog
Copy link

@pyhedgehog pyhedgehog commented Feb 25, 2017

Already implemented in mintty: mintty/mintty#569 (comment)

@jasir
Copy link
Author

@jasir jasir commented Mar 2, 2017

Hmm, I should try mintty... Thans

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 2, 2017

I don't like the idea: ChildGui

@jasir
Copy link
Author

@jasir jasir commented Mar 3, 2017

Sorry, I do not understand. Is it a typo, you wanted to say "I don't like the idea?"

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 3, 2017

Sure, smartphone...

@jasir
Copy link
Author

@jasir jasir commented Mar 3, 2017

:( Ok. Please reconsider, it would be great for powerusers. Otherwise, I will close this, do not want to keep another zombie issue in Conemu.

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 3, 2017

I didn't say "it bad feature". I'm going to implement it in ConEmu.

@jasir
Copy link
Author

@jasir jasir commented Mar 3, 2017

Oh. Then this was my epic misunderstanding... Thank you very very much!

@pyhedgehog
Copy link

@pyhedgehog pyhedgehog commented Mar 4, 2017

@Maximus5, could you please explain — what do you dislike?

  1. Implementing new (non-standard) escape sequence? There are plenty of them...
  2. Copying solution from mintty?
  3. Implementing escape-sequence (i.e. remote-controlled) for bookmarks?
  4. Such solution for original request (bookmarks on shell prompts/user entry "fields" — inexistant in console)?
@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 4, 2017

@pyhedgehog I dislike mintty started in ConEmu.

As for your points

The escape sequence already exists: ConEmu specific OSC.
Copying solution from mintty is impossible. mintty doesn't work with real console as ConEmu does. So mintty doesn't face the hell of synchronization between its internal buffers and real console ones.

As I said, scrolling shortcuts will be implemented.

@pyhedgehog
Copy link

@pyhedgehog pyhedgehog commented Mar 4, 2017

There was misunderstanding also. I've mentioned only copying solution — not implementation. I.e. I want to be sure that escape sequences for same features existing in mintty and conemu will be same.

Maximus5 added a commit that referenced this issue Mar 6, 2017
  Ctrl+Alt+PgUp/PgDn will jump between commands entered in the shell prompt.
  Take into account that prompt must pass to ConEmu the code
  `ESC]9;12ESC\` (ConEmu default) or `ESC[?7711h` (mintty implementation).
@jasir
Copy link
Author

@jasir jasir commented Jun 5, 2017

I would love to test this functionality, but I cannot make it work. I have tried many times, but i am lost.
I am using bash

PS1 = ${PS1}\e[?7711h"

...and many other variants, still no success...

Thanks a lot for help

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Jun 5, 2017

@jasir What exact bash of dozens of its implementations you are trying?
Hint: http://conemu.github.io/en/CygwinAnsi.html

@jasir
Copy link
Author

@jasir jasir commented Jun 5, 2017

I am using bash comming from git for windows distrubution.

@jasir
Copy link
Author

@jasir jasir commented Jun 5, 2017

Ok, this is a subset of my prompt:

ESC=$(printf '\033')
MARKER="${ESC}[?7711h"

PS1="${MARKER}\n→ \[\e[01;32m\]\t$( a=$?; if [ $a = 0 ]; then echo " "; else echo "\[\e[31m\] [$a] "; fi )\[\e[01;33m\]"
@jasir
Copy link
Author

@jasir jasir commented Jun 5, 2017

Ok, it seems that when I use msys connector, it uses. Thanks. Should I close this task?

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Jun 5, 2017

@jasir
Copy link
Author

@jasir jasir commented Jun 6, 2017

I am closing issue, as this is working. Unfortunately, there are more issues with msys connector, so I won't use this 👎. Thanks anyway, I believe this is great feature and should be more promoted.

@jasir jasir closed this Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.