mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 19:37:24 +08:00

Today the reader exposes its internals directly, e.g. to the commandline builtin. This is of course not thread safe. For example in concurrent execution, running `commandline` twice in separate threads would cause a race and likely a crash. Fix this by factoring all the commandline state into a new type 'commandline_state_t'. Make it a singleton (there is only one command line after all) and protect it with a lock. No user visible change here.