window: Move operations with mode from the `on_execute` function
window: Command execution mechanism to the `execute_command` function