Skip to content

"restart()" Julia and keep activated path and working directory #32129

Open

Description

A feature request of a restart() function which restarts Julia and keeps the current working directory, the activated path and the window. This feature would be independent of a future comeback of the workspace function (#25046).

An almost-implementation by @fredrikekre:

function restart()
    startup = """
        Base.ACTIVE_PROJECT[]=$(repr(Base.ACTIVE_PROJECT[]))
        Base.HOME_PROJECT[]=$(repr(Base.HOME_PROJECT[]))
        cd($(repr(pwd())))
        """
    cmd = `$(Base.julia_cmd()) -ie $startup`
    atexit(()->run(cmd))
    exit(0)
end

This version is nested, so it keeps old display windows open etc. The actual solution would call exec with the right arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    featureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions