| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed Nov 01, 2006 9:58 pm Post subject: Scrolling the Command Prompt |
|
|
On Linix it is very natural to scroll the terminal from the keyboard in case of a long output. Of course, it can also be done with the mouse, but it is not convenient, since when using the command prompt your hands are already on the keyboard.
That's why I made this small script which scrolls the command prompt window with shift+pgup/down. Aside from a little flashing by the system menu, it works perfectly:
| Code: | #IfWinActive, ahk_class ConsoleWindowClass
+pgup::send, {alt down}{space}{alt up}el{pgup}{esc}
+pgdn::send, {alt down}{space}{alt up}el{pgdn}{esc}
#IfWinActive
|
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Nov 01, 2006 10:04 pm Post subject: |
|
|
| I used shift+pgup/down, because that's the default on Linux. Simple pgup/down could also be used here, since their default binding in the command prompt seems pretty useless to me. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Nov 01, 2006 10:36 pm Post subject: |
|
|
Yes, I wrote this. Pretty nifty, eh? I forget posting though.  |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Nov 01, 2006 11:05 pm Post subject: |
|
|
| Seems like some different Guests here. The drawback of posting anonymously... |
|
| Back to top |
|
 |
JSLover
Joined: 20 Dec 2004 Posts: 530 Location: LooseChange911.com... the WTC attacks were done by the US Gov't... the official story is a lie...
|
Posted: Wed Nov 01, 2006 11:19 pm Post subject: |
|
|
| Code: | ;//Uncomment one at a time...(can't use if in this case)...
#IfWinActive, ahk_class ConsoleWindowClass
;//scroll=smooth
+pgup::Send, {WheelUp}
+pgdn::Send, {WheelDown}
;//scroll=page
;+pgup::Click, WheelUp
;+pgdn::Click, WheelDown
;//scroll=weird
;+pgup::WheelUp
;+pgdn::WheelDown
;//scroll=menu
;+pgup::send, {alt down}{space}{alt up}el{pgup}{esc}
;+pgdn::send, {alt down}{space}{alt up}el{pgdn}{esc}
#IfWinActive |
| Anonymous wrote: | | ...since their default binding in the command prompt seems pretty useless to me. |
...their default action is moving to the top or bottom of the command history...I always use page down to re-run the last command...or at least insert the last command into the line so I can edit it & re-send it...default page up/down in command prompt is useful... _________________
Home • Click image! • Blog |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 594 Location: Texas, USA
|
Posted: Thu Nov 02, 2006 12:28 am Post subject: |
|
|
| JSLover wrote: | | Code: | #IfWinActive, ahk_class ConsoleWindowClass
;//scroll=page
+pgup::Click, WheelUp
+pgdn::Click, WheelDown
#IfWinActive
|
|
I like the Click WheelUp|WheelDown. I'm not sure why it works like it does (I would think that it would scroll up|down 1 line at time, not 1 page at a time), but I'm not complaining. OK, not that much.
Thanks for the tip. I'll add it to the list of my other DOS-only hotkeys. |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 02, 2006 6:24 am Post subject: |
|
|
| The wheel thingie is a pretty nice improvement. No flickering than with the menu solution. Thanks! |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6789 Location: France (near Paris)
|
Posted: Thu Nov 02, 2006 9:33 am Post subject: |
|
|
Too many Guests here...
Hey, JSLover, good one! It went to my list of permanent hotkeys.
Now, I need something to allow to search in the console... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 02, 2006 9:51 am Post subject: |
|
|
| PhiLho wrote: | | Now, I need something to allow to search in the console... |
Well, it's pretty easy to do based on my original suggestion:
| Code: | #IfWinActive, ahk_class ConsoleWindowClass
^f::send, {alt down}{space}{alt up}ef
#IfWinActive |
|
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 02, 2006 9:56 am Post subject: |
|
|
It's even better if search direction is set backwards, so that the latest output is searched first:
| Code: | #IfWinActive, ahk_class ConsoleWindowClass
+pgup::Click, WheelUp
+pgdn::Click, WheelDown
^f::send, {alt down}{space}{alt up}ef{alt down}u{alt up}{alt down}n{alt up}
#IfWinActive
|
|
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 02, 2006 9:58 am Post subject: |
|
|
| Until know the command prompt was almost unbearable for me after using the mature Linux terminals. With these improvements it's much more user friendly. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4263 Location: Belgrade
|
Posted: Thu Nov 02, 2006 10:04 am Post subject: |
|
|
You have extended consoles all around the net with planty of supportive features... _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6789 Location: France (near Paris)
|
Posted: Thu Nov 02, 2006 10:04 am Post subject: |
|
|
Stupid me, I didn't noticed there was a search option in the console!
Note that the shortcuts you give won't work for me, using a French Windows... But it is easy to change them.
Hey, Guest, do you know you can use a nickname without even having to register? It is nicer to put a name on posts. There should be a JavaScript checking if you forget to fill the nickname field, it doesn't work for you? (just curiosity...) If not, do you have deactivated JS? Or what browser do you use? _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 02, 2006 10:11 am Post subject: |
|
|
I'm a registered user here, but I made the first post as Guest out of pure lazyness.
Since I can't prove it was me who made the first post I continue to post as Guest here, so that I don't make the impression I'm taking credit for someone else's work. |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Nov 02, 2006 10:14 am Post subject: |
|
|
| majkinetor wrote: | | You have extended consoles all around the net with planty of supportive features... |
Any urls? |
|
| Back to top |
|
 |
|