a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

auto-complete aliases in .profile

Open martinorob opened this issue 2 years ago • 8 comments

The auto-complete (tab) for aliases in .profile seems doesn’t works. if in .profile i have alias sshhome=‘ssh user@host’

when i write ssh and press tab it doesn’t autocomplete with …home

martinorob avatar Sep 02 '21 11:09 martinorob

Hi, you're right, this won't work: I did not include the aliases in the list of commands for auto-complete. I'll see what I can do.

holzschu avatar Sep 02 '21 11:09 holzschu

It would be awesome! Thanks

martinorob avatar Sep 02 '21 12:09 martinorob

ehy, I am trying to alias some stuff as well, it does not work. is it enabled?

Bleighhhh avatar Feb 10 '22 13:02 Bleighhhh

It should work. Can you provide more information: what did you try, what did it do?

holzschu avatar Feb 10 '22 13:02 holzschu

It should work. Can you provide more information: what did you try, what did it do?

I opened the .profile and put this line: "alias ssh='ssh user@ipaddress' " I saved and I tried to run it but it did not work. I am fairly new to terminal and ssh, have I misunderstood something?

Bleighhhh avatar Feb 10 '22 13:02 Bleighhhh

So, we need to debug things one by one. First, does the alias command work on it own? (i.e., if you type "alias ssh='ssh user@ipaddress'" at the prompt, then "alias", does it show that the command has been well understood, and a new alias created?). Second, does it do what you want? (once the alias is in, if you type "ssh", does it try to connect to ipaddress? Third, does the .profile work? You said you "tried to run it", but how exactly did you try to run the .profile?

holzschu avatar Feb 10 '22 13:02 holzschu

Okay, I had misuderstood. I assumed .profile worked as .bashrc file.

Now I did your point 1) and the alias worked perfectly. May I ask you where am I to place the ssh public key for making it work on a-shell?

Bleighhhh avatar Feb 10 '22 14:02 Bleighhhh

The public keys go into ~/Documents/.ssh/ (basically, every configuration file goes in the usual place, but moved to ~/Documents/ instead of ~, because we can't write in ~). If you type ssh-keygen to generate a key, it will create the directory. You can also copy the .ssh directory from another machine to there.

The .profile will be executed each time you open the app. Each line will be executed in order. It does not work with if conditions or function definitions.

holzschu avatar Feb 10 '22 14:02 holzschu