Fork me on GitHub
#spacemacs
<
2020-11-03
>
murtaza5210:11:02

Hi, I want to add an eshell alias ex alias ll="ls -l" where should I do that ?

murtaza5210:11:50

also my project is using direenv and would like to initialize that when in eshell. this is what I have to add in bash eval "$(direnv hook bash)" any leads on how I can accomplish the same for eshell ?

otwieracz12:11:28

I don’t think it’s possible. eshell is simply not supported.

murtaza5212:11:24

hmm and how about the alias ?

otwieracz12:11:56

(defalias 'll "ls -la")

murtaza5212:11:13

or just running a command - ssh-add /home/myuser/.ssh/id_rsa

otwieracz12:11:19

So I am not sure if and how ssh-agent is able to work within eshell environment.

otwieracz12:11:51

But from what I see, it’s working just fine.

otwieracz12:11:19

But you shouldn’t expect that sh-specific utilities will work in eshell.

murtaza5213:11:00

can you elaborate more on this ? why could this be a problem ?

murtaza5214:11:44

I am using a leiningen plugin which uses ssh, and thus my ssh key needs to be added to the agent.

otwieracz14:11:25

So basically things like direnv expect sh-compliant shell.

otwieracz14:11:57

There might be some problems trying to use them in eshell.

otwieracz14:11:23

Depending on the actual software. Many of those utilities define new aliases, functions - those things won’t work in eshell.

otwieracz14:11:01

ssh-agent should work - you should be able to perform ssh-add assuming SSH_AUTH_SOCK gets set correctly in eshell from parent process.

otwieracz14:11:25

> env
(...)
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.tfJGULxVPd/Listeners
(...)

otwieracz15:11:08

But ~/.profile is only executed by sh-compliant shells which eshell is not.

otwieracz15:11:09

And IIRC everything you want to have in .profile should be translated into elisp code put into .emacs

murtaza5208:11:30

great thanks, I am using ansiterm as you had suggested

otwieracz12:11:17

Are you sure you want to use eshell ?

otwieracz12:11:28

Because, from what you are saying, it seems like a bad choice for you.

Edmund12:11:03

Has anyone ever run into the below issue trying to start a repl: [nREPL] Starting server via "c:/Program Files/Leiningen/lein.bat" update-in :dependencies conj ^"[nrepl \^"0.8.2\^"]^" -- update-in :plugins conj ^"[refactor-nrepl \^"2.5.0\^"]^" -- update-in :plugins conj ^"[cider/cider-nrepl \^"0.25.4\^"]^" -- repl :headless :host localhost error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: java.lang.NumberFormatException: Invalid number: 0.8.2 at clojure.lang.LispReader.readNumber (LispReader.java:352) clojure.lang.LispReader.read (LispReader.java:278) clojure.lang.LispReader.readDelimitedList (LispReader.java:1398) clojure.lang.LispReader$VectorReader.invoke (LispReader.java:1347) clojure.lang.LispReader.read (LispReader.java:285) clojure.lang.LispReader.read (LispReader.java:216) clojure.lang.LispReader.read (LispReader.java:205)

practicalli-john14:11:43

My first guess would be to check for a .lein/profiles.clj file, which I assume should be in what ever Windows thinks is your home directory. If that fle it exists, try move it to a different location or rename the file. Otherwise it sounds like a bug with the windows install of Leiningen or a bug in cider. Possibly with the path not being interpreted correctly. I do not have a windows system to try and replicate the issue, sorry.

Edmund14:11:34

Thanks let me try those options. I've tried starting the repl using powershell and lein directly and it works (lein repl). Let me try this. I've never seen this error.

practicalli-john15:11:08

If the issue is related to windows, there is the #clj-on-windows channel. The error suggests to me that its not reading the auto-injected dependencies from Cider correctly. You could try getting the command line from the Spacemacs message buffer, SPC b m , it should show the command that cider-jack-in used to try start the repl. Or failing that, use SPC u before cider-jack-in to see the command. Then try that command using a windows terminal / powershell...

Edmund15:11:58

It looks like its this command: update-in :dependencies conj "[nrepl \"0.8.2\"]" -- update-in :plugins conj "[refactor-nrepl \"2.5.0\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.25.4\"]" -- repl :headless :host localhost and I can see where its reading the 0.8.2 where its failing. Running this with "ava.lang.RuntimeException: EOF while reading"

Edmund15:11:23

After bouncing into this article: https://www.gitmemory.com/issue/clojure-emacs/cider/2890/674136255 Removing java jdk and installing Java Runtime.. solved the problem. Now idea why the JDK wouldn't work. Thanks for all your help and an awesome tool.

practicalli-john15:11:24

Glad its resolved, I would not have thought of changing from JDK to JRE.

practicalli-john14:11:20

@murtaza52 If you cannot find help using eshell, you could use your operating system shell from within Spacemacs. Then any configuration of the OS shell should be available. https://practicalli.github.io/spacemacs/install-spacemacs/eshell.html#multi-term---use-operating-system-shell

murtaza5214:11:03

@jr0cket thanks, I think that works better for now

otwieracz14:11:12

@murtaza52 or just use ansi-term instead of eshell.