For text command I can use
def is_enabled(self):
return self.view.match_selector(0, "source.python")
to enable my plugin for Python sources only. I need to ask for user input using the window command. This command does not have a view, though. How can I make a window command run for a specific scope only?