I installed Code (the new Scratch) via the instructions here. I also created an alias in my .bashrc file to launch it for purposes of running as su:

alias code = 'io.elementary.code'

Unfortunately the alias does not work. And I can no longer launch Scratch via the terminal (errors out). Therefore I can no longer edit text files in su. Sure I can install GEdit or run VIM or whatever, but I don't want to use those.

Assistance please :)

1 Answer 1


Try removing the spaces between the equals sign.

So change:

alias code = 'io.elementary.code'


alias code='io.elementary.code'
  • that works! Thank you. Any idea how to use sudo -i in conjunction with my alias?
    – pretz
    Nov 14, 2017 at 12:34
  • 1
    You might want to use pkexec (alias code-sudo="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY io.elementary.code") instead, as using sudo with scratch is known to cause problems. I don't know if this applies to Code. This will ask you for your password though.
    – Aljelly
    Nov 14, 2017 at 12:50
  • I mentioned running code with sudo and the devs recommended running with -i to reduce issues. I just hate terminal based editors :) I'll give your recommendation when I get home. thanks!
    – pretz
    Nov 14, 2017 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.