Fish Shell 4.0 Beta Release: Rust Rewrite brings Major Improvements
The highly acclaimed Fish shell has just released a new beta version—4.0! This is a major change, because this is the first version after its major rewrite. Fish shell was originally written in C, but now it is written in Rust. This means that the core code of the shell has been completely changed.
The first beta version of Fish shell 4.0 brings many changes, no matter how big or small. Here are some highlights:
Catalog
The developers of Fish shell chose Rust as their target language for rewriting, mainly based on the following key reasons:
Rust is a system programming language with a wide platform support for , a huge and active community, and is likely to remain important in the future. This is a key consideration because developers want to ensure long-term sustainability of projects. Developers also believe that Rust's Security and reliability
features will help prevent errors and make the shell more stable. This is especially important because the shell is used to control computers and errors can have serious consequences.More importantly, Rust's unique advantages in thread safety
functionality provide solutions to the challenge of enabling concurrency mode in Fish shell. This is a long-standing goal for developers, but it is difficult to achieve safely in C.Finally, the developer considered other languages, but ultimately thought Rust was the best fit
.They ruled out Java, Python, and other scripting languages because of concerns about startup latency and memory usage.
Go language is considered inappropriate due to its handling of fork system calls.Other system programming languages, such as D, Nim, and Zig, are considered too niche, meaning they contribute fewer and have a higher risk of becoming irrelevant in the future.
Major improvements to Fish Shell 4.0 Beta
This beta version of Fish shell (4.0b1) includes
First of all, Fish now requests XTerm's modifiedOtherKeys keyboard encoding and progressive enhancements to the kitty keyboard protocol, which may allow for more key combinations to be bound, depending on terminal support.
In addition, bind now supports human-readable syntax. Fish can now also be built as a self-install binary.
Secondly, many improvements have been made to scripting and interactive use. For example, pressing ctrl-c during command entry will only clear the command line, rather than printing ^C and a new prompt.
Binding can now also be mixed with special input functions and shell commands. ctrl-r History Search now uses glob syntax and only operates on line or command replacements at the cursor, making it easier to combine commands in history. The abbreviation can now be limited to specific commands.
Thirdly, there are many interactive improvements, including the undo history no longer being truncated after each command, and ctrl-v now removes the ASCII control characters from the pasted text.
There are also some new or improved bindings, including alt-o for opening the current command in the editor, and shift-delete for deleting the current search and moving to the next older item during the up arrow history search.
There are also some improvements in completion, such as command-specific tab completion now provides the result of the first character as a period, and option completion now uses fuzzy subsequence filtering.
Finally, this release includes improved terminal support, including Fish now marks prompts and command output areas (via OSC 133) to enable terminal shell integration and unconditionally report working directories (via OSC 7).
This is just a brief overview of many changes in this release. You can find more detailed information in the release notes on GitHub.
This beta version is a major advancement in Fish. It’s exciting to see the future of this popular shell! If you want to give it a try, you can download it from the Fish release page on GitHub.
Please note that this is a beta version, so there may be some errors. If you are using Fish for important work, it is best to wait for the final release.
But if you like to try new things and help with testing, keep trying! You can report any issues you find on the Fish GitHub page.
The above is the detailed content of Fish Shell 4.0 Beta Released: Major Rewrite In Rust With Key Improvements. For more information, please follow other related articles on the PHP Chinese website!