AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scrolling the Command Prompt
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Nov 01, 2006 9:58 pm    Post subject: Scrolling the Command Prompt Reply with quote

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






PostPosted: Wed Nov 01, 2006 10:04 pm    Post subject: Reply with quote

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






PostPosted: Wed Nov 01, 2006 10:36 pm    Post subject: Reply with quote

Yes, I wrote this. Pretty nifty, eh? I forget posting though. Twisted Evil
Back to top
Guest






PostPosted: Wed Nov 01, 2006 11:05 pm    Post subject: Reply with quote

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...

PostPosted: Wed Nov 01, 2006 11:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jballi



Joined: 01 Oct 2005
Posts: 594
Location: Texas, USA

PostPosted: Thu Nov 02, 2006 12:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Guest






PostPosted: Thu Nov 02, 2006 6:24 am    Post subject: Reply with quote

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)

PostPosted: Thu Nov 02, 2006 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Nov 02, 2006 9:51 am    Post subject: Reply with quote

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






PostPosted: Thu Nov 02, 2006 9:56 am    Post subject: Reply with quote

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






PostPosted: Thu Nov 02, 2006 9:58 am    Post subject: Reply with quote

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

PostPosted: Thu Nov 02, 2006 10:04 am    Post subject: Reply with quote

You have extended consoles all around the net with planty of supportive features...
_________________
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6789
Location: France (near Paris)

PostPosted: Thu Nov 02, 2006 10:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Nov 02, 2006 10:11 am    Post subject: Reply with quote

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






PostPosted: Thu Nov 02, 2006 10:14 am    Post subject: Reply with quote

majkinetor wrote:
You have extended consoles all around the net with planty of supportive features...


Any urls?
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group