Skip to content

Instantly share code, notes, and snippets.

@reisblucas
Last active September 5, 2022 02:03
Show Gist options
  • Save reisblucas/bc8b6dd3d139b26ae5e422c028c429c0 to your computer and use it in GitHub Desktop.
Save reisblucas/bc8b6dd3d139b26ae5e422c028c429c0 to your computer and use it in GitHub Desktop.

Linux terminal alias for JetBrains Rider IDE as VSCode do when type 'code':

OS:

  • Linux Distros
  • macOS
  • Windows

What does that solve?

  • When Rider Standalone version is installed in Linux, it comes without shell scripts, this gist can solve your problem.

DISCLAIMER:

  1. If you have more than one IDE from JetBrains, I strongly recommend you to install the Toolbox App, it solve the problem in the best way and do all the job for you, about update, shell scripts and what is necessary to your IDEs works correctly/uses of scripts in terminal!
  2. Tested only at the Ubuntu os, if you try in another system, let us know in the comments at the end of the gist!

How to solve:

  • Verify where your JetBrains Rider was installed;
  • Now you need to create an alias in your shell or zsh root:

ZSH:

  1. Access your /.oh-my-zsh folder; /home/{userName}/.oh-my-zsh/custom
  2. Inside it, create a file anyName.zsh;
  3. Add the following alias in your new file alias rider_path="/{yourPathToRider}/'JetBrains Rider-2022.2.1'/bin/rider.sh";
  4. At the terminal, get back to the root path;
  5. Add this function to the final of your .zshrc file:
# rider open project
function rider() {
  rider_path 0>/dev/null 1>/dev/null 2>/dev/null $1 &
}
# rider end
  1. Type source ~/.zshrc in your terminal;
  2. In some cases, in addition to step 6, you should need to close your terminal and open a new one and to test the new alias.

BASH:

  1. At the root path, edit your /.bashrc folder; /home/{userName}/.bashrc
  2. Add the following alias in your file alias rider_path="/{yourPathToRider}/'JetBrains Rider-2022.2.1'/bin/rider.sh";
  3. At the terminal, get back to the root path;
  4. Add this function to the final of your .bashrc file:
# rider open project
function rider() {
  rider_path 0>/dev/null 1>/dev/null 2>/dev/null $1 &
}
# rider end
  1. Type source ~/.zshrc in your terminal;
  2. In some cases, in addition to step 6, you should need to close your terminal and open a new one and to test the new alias.

Contributions:

  • @minsk-dev: Implemented the Null device operation to work as planned, add & operator at the end of userInput at the terminal.

I expect it should help you! 🚀

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