Comments (4)
@prasoon2211 Sorry, I no longer use shell-pop
. I vaguely recall this issue wasn't just due to shell-pop
, but I'm not very sure.
from shell-pop-el.
Sorry to revive the dead thread. @dwrz did you find a fix for this perhaps?
from shell-pop-el.
@prasoon2211 I've had this issue too. It seems to be fixable by advising #'shell-pop--cd-to-cwd-eshell to only run in eshell buffers and only auto-cd when necessary. I've also had to work around another, possibly related, bug involving the buffer directory not being detected properly. Taking the directory part of buffer-file-name seems to work much better then default-directory.
With these workarounds shell-pop works well for me using Emacs 27.1 on Debian.
(defun sv/fixed-shell-pop--cd-to-cwd-eshell (cwd)
(if (string= major-mode "eshell-mode")
t
(message "Trying to set eshell CWD (%s) outside of eshell!" cwd)
nil))
(advice-add 'shell-pop--cd-to-cwd-eshell :before-while #'sv/fixed-shell-pop--cd-to-cwd-eshell)
(defun sv/shell-pop (arg)
(interactive "P")
(let ((default-directory
(or (file-name-directory (or (buffer-file-name) "")) default-directory))
(shell-pop-autocd-to-working-dir (stringp (buffer-file-name))))
(shell-pop arg)))
(define-key xah-fly-leader-key-map (kbd "z") #'sv/shell-pop)
config:
(setq shell-pop-default-directory (expand-file-name "~")
shell-pop-shell-type '("eshell" "*eshell*" (lambda () (eshell)))
shell-pop-universal-key nil
shell-pop-window-size 30
shell-pop-full-span t
shell-pop-autocd-to-working-dir t
shell-pop-window-position "bottom")
from shell-pop-el.
I found the issue to be problematic when running shell-pop while in an org file with code blocks. If a code block tangles to a relative path, for example #+begin_src :tangle ./setup
, and it intends to tangle to /home/user/code/project1/setup
, after running shell-pop, it would try to tangle to /home/user/setup
instead, as the default-directory
would've changed from /home/user/code/project1/
to /home/user/
.
I haven't tried @SirVolta's solution yet, but i might just use popper.el instead, which can turn any buffer into a pop-up window, so i'll use that and script together a makeshift pop-up terminal instead.
Update: the package multi-term provides a command to create a dedicated pop-up terminal window (multi-term-dedicated-toggle
), just like shell-pop does. There's another called multi-vterm, which only supports vterm (I'm assuming this had to be created because of compatibility issues between vterm and multi-term). I've tried multi-vterm and it works great, but multi-term, the original, doesn't work as well as shell-pop, nor does it support eshell...
from shell-pop-el.
Related Issues (20)
- Feature request: configure different keybindings for different types of shell HOT 3
- Eshell colors didn't get applied?
- Set the shell type in dot-emacs. HOT 4
- Support login shell HOT 2
- Popping out shell window changes other buffer HOT 4
- Full Span and Neotree HOT 2
- Layout breaks in Emacs 25.1 HOT 3
- shell-pop breaks list-registers HOT 3
- Documentation is outdated HOT 1
- Strange ^L? HOT 3
- The layout was not expected when the shell was first opened. HOT 1
- Switch the display logic to `display-buffer`
- Document the proper way to set the shell type
- Full Width when split 2 window with 1 Treemacs HOT 3
- First invocation always in wrong position HOT 1
- add-hook for eshell-exit-hook causes eshell to not write history out. HOT 1
- shell-pop-universal-key not working HOT 2
- How To see History output HOT 3
- Eshell not working on windows HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shell-pop-el.