spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
murtaza52 2020-11-03T10:16:02.107700Z

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

murtaza52 2020-11-03T10:17:50.109100Z

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 ?

murtaza52 2020-11-03T10:19:01.109400Z

(https://direnv.net/)

otwieracz 2020-11-03T12:08:28.110900Z

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

murtaza52 2020-11-03T12:09:24.111400Z

hmm and how about the alias ?

otwieracz 2020-11-03T12:09:56.112Z

(defalias 'll "ls -la")

otwieracz 2020-11-03T12:09:59.112200Z

iirc

otwieracz 2020-11-03T12:10:10.112600Z

of, no.

murtaza52 2020-11-03T12:10:13.112800Z

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

otwieracz 2020-11-03T12:10:28.113Z

https://www.emacswiki.org/emacs/EshellAlias

otwieracz 2020-11-03T12:13:19.114Z

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

otwieracz 2020-11-03T12:13:51.114300Z

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

otwieracz 2020-11-03T12:14:19.114800Z

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

murtaza52 2020-11-04T08:41:30.122300Z

great thanks, I am using ansiterm as you had suggested

otwieracz 2020-11-03T12:15:17.115500Z

Are you sure you want to use eshell ?

otwieracz 2020-11-03T12:15:28.115800Z

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

Edmund 2020-11-03T12:36:03.116600Z

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)

murtaza52 2020-11-03T13:58:00.116700Z

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

murtaza52 2020-11-03T14:01:44.116900Z

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

practicalli-john 2020-11-03T14:11:20.118300Z

@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

practicalli-john 2020-11-03T14:16:43.118400Z

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.

murtaza52 2020-11-03T14:19:03.118800Z

@jr0cket thanks, I think that works better for now

Edmund 2020-11-03T14:45:34.118900Z

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.

otwieracz 2020-11-03T14:53:12.119300Z

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

otwieracz 2020-11-03T14:55:25.119400Z

So basically things like direnv expect sh-compliant shell.

otwieracz 2020-11-03T14:55:57.119600Z

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

otwieracz 2020-11-03T14:57:23.119800Z

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

otwieracz 2020-11-03T14:59:01.120Z

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

otwieracz 2020-11-03T14:59:25.120200Z

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

otwieracz 2020-11-03T15:00:08.120400Z

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

otwieracz 2020-11-03T15:01:09.120600Z

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

practicalli-john 2020-11-03T15:02:04.121300Z

@murtaza52 or vterm if you want the latest way of using a terminal in Spacemacs https://develop.spacemacs.org/layers/+tools/shell/README.html#install-vterm

practicalli-john 2020-11-03T15:07:08.121400Z

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...

Edmund 2020-11-03T15:12:58.121600Z

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"

Edmund 2020-11-03T15:51:23.121800Z

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-john 2020-11-03T15:58:24.122Z

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