Sublime Forum

Trigger InputHandler implemented in other package


Hi all,
I am developing a plugin ( that I would like to separate into two different plugins.


class FooCommand(sublime_plugin.WindowCommand):
    def run(self, foo_arg):

    def input(self, args):
        return FooArgInputHandler()

FooArgInputHandler() would also be implemented in

In, I would like to implement something like this:

class BarCommand(sublime_plugin.WindowCommand):

    def run(self, bar_arg):
        # does something with bar_arg

    def input(self, args):
        return BarArgInputHandler()

because no args are provided when calling run_command, then I would expect Sublime to instantiate and display FooArgInputHandler. Instead, I get an error:

run() missing 1 required positional argument: 'foo_arg'

My workaround is that BarArgInputHandler() has a next_input() to return FooArgInputHandler(), then takes two arguments (bar_arg, foo_arg) and I can run foo command with foo_arg.

But then I cannot separate into two different plugins, because I don’t know how to import FooArgInputHandler() from

I think that this use case should be very common, and most probably I am doing something obviously wrong. Can you help me?

Many thanks!



Did you make sure that the foo command is available in the command palette ? One of the requirements to successfully implement an InputHandler is to make sure that the command invoking it’s instance via input method should be present in the command palette i.e. an entry in the .sublime-commands file adding the foo command to the palette.

1 Like


Ok, so that was it. I added foo command to the palette and now it works as expected.
Thank you very much for your help. I knew there should be an easy way!