It is modified from fish-3.7.0