1

I have assigned a new Global hotkey to

VS 2010/Options/Environment/Keyboard/OtherContextMenus.FSIConsoleContext.ResetSession

But it seems to work only in the FSI window. How can I make the hotkey work globally?

Brian
  • 117,631
  • 17
  • 236
  • 300
Oldrich Svec
  • 4,191
  • 2
  • 28
  • 54
  • 1
    It says FSIConsoleContext, what do you mean by resetting session globally? – Yet Another Geek Jun 24 '11 at 13:30
  • Well, what I want to do is to hit a hotkey while writing the F# code (i.e. being in the editor window) to reset the FSI console window without even taking focus to the FSI window. Is that possible? – Oldrich Svec Jun 25 '11 at 10:51

1 Answers1

1

I don't think you can do it the way you describe it (the hotkey will only work within the context of the FSI window), but you can use a VS Macro to change the focus to the FSI console, reset the session and move back;

the following worked for me: (needs additional error handling etc)

Sub ResetFSharpMacro()
    Dim WindowName As String
    WindowName = DTE.ActiveDocument.Name
    DTE.ExecuteCommand("View.F#Interactive")
    DTE.ExecuteCommand("OtherContextMenus.FSIConsoleContext.ResetSession")
    DTE.Windows.Item(WindowName).Activate()
End Sub

You can then use Macros.MyMacro.... to assign a global hotkey

Dirk
  • 2,348
  • 17
  • 23