0

In Windows, when I'm using the command prompt and launch Vim, I have a habit of trying to scroll through files using the mouse-wheel (which of course works in gVim but not inside the terminal).

Is there a way to configure the Windows command prompt to automatically disable scrolling (with both the scrollbar and the mousewheel) whenever an application is launched that runs inside the console window itself?

Ideally, there should be a way to have Windows "intelligently" determine whether scrolling should be disabled (since some applications, such as ssh, benefit from having scrolling available). Failing that, since Vim is the only application I use that behaves poorly when I try to scroll within it, I'd like to be able to just specify that launching Vim should always disable scrolling.

  • 1
    set mouse=a ?? :help mouse in Vim – lornix Jun 27 '14 at 19:03
  • @lornix Nope, that's inside Vim and controls how Vim responds to scrolling. – Kyle Strand Jun 27 '14 at 19:35
  • Your question makes it difficult to determine whether you're looking to disable vim scrolling, or disable the terminal window scrolling. Not that 'cmd.exe' is much of a terminal to begin with. Have you looked at the cmd.exe command line options? cmd /? ? – lornix Jun 27 '14 at 19:38
  • I said "configure the Windows command prompt to automatically disable scrolling," and that's what I meant. And yes, I realize cmd.exe is a lousy terminal (to be charitable), but it turns out it actually does support precisely the feature I wanted; see my answer below. – Kyle Strand Jun 27 '14 at 19:39
2

Apparently cmd.exe does intelligently disable scrolling by default, actually; my problem was that I was inside an ssh session, so Windows didn't actually know I was running vim. (I doubt there's a way to make the scrollbar disappear when you launch vim inside an ssh session inside cmd.exe.)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.