Skip to content

Stop disabling autosave with --watch #6534

@jooh

Description

@jooh

Description

Marimo blocks autosave when running with --watch, see

#4194
#4196
#6167

For our UC it would be helpful to have the option to enable both watch and autosave.

We use watch to detect external changes from git operations like branching. For changes coming from marimo like autosave, git will pick that up as an unstaged diff.

You could argue that it's on the other application (editor or otherwise) to handle potentially conflicting writes coming from your autosave functionality. Most editors are pretty good about warning when a file has changed externally.

Seems like something that should be possible, with the appropriate warnings and caveats.

Suggested solution

Could be as easy as removing the config override here and turning the info into a warning.

# If watch is true, disable auto-save and format-on-save,
# watch is enabled when they are editing in another editor
if watch:
config_reader = config_reader.with_overrides(
{
"save": {
"autosave": "off",
"format_on_save": False,
"autosave_delay": 1000,
}
}
)
LOGGER.info("Watch mode enabled, auto-save is disabled")

The GUI and the docs should probably warn that running watch and autosave together can cause problems.

Are you willing to submit a PR?

  • Yes

Alternatives

Is it possible to yoke the watch and autosave hooks so autosave only runs after a watch update?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions