Commit Graph

36 Commits

Author SHA1 Message Date
Daniel - 9441800587
Also change to `default-directory` when not in eshell already
This is the expected behavior, and also how `db/run-or-hide-shell` works.  The
implementation is structured differently, though … because I reinvented the
implementation of `db/run-or-hide-eshell` instead of generalizing the one of
`db/run-or-hide-shell`.  Ah, anyway …
2023-10-12 16:39:29 +02:00
Daniel - 8e192e5cfb
Downcase login name in eshell prompt
Windows sometimes likes to display the login name in all-caps, this is annoying.
2023-05-09 17:53:36 +02:00
Daniel - 2f1868da43
Only treat automatically named (e)shell buffers special
This allows to have custom named (e)shell buffers that are treated like any
other buffer, and not as the special bottom shell buffers.
2023-04-16 19:02:24 +02:00
Daniel - 7d5c6624e6
Improve eshell git prompt check for ongoing merges
Checking for filenames is fragile if gitdir files are being used (as is common
for submodules).  Better try to resolve MERGE_HEAD via git.
2023-03-23 20:02:40 +01:00
Daniel - 6bac3973f9
Make eshell git prompt function more robust
When checking whether we are in a git repository or not, remove all symbolic
links in the current path before looking for a .git in the current path;
otherwise, symbolic links might mislead `locate-dominating-file` to find some
.git directory which is only reachable via symbolic links, which subsequently is
ignored by git (rightly so!) and thus yields errors.

Also, catch the case that the current git repository is not initialized yet by
checking the return value of `git rev-parse --abbrev-ref HEAD`.
2023-03-23 19:50:35 +01:00
Daniel - 47d7e31800
Let display-buffer handle window placement for shells
This provides the same functionality, but makes it more configurable.
2023-02-13 13:22:51 +01:00
Daniel - aec896c939
Always display shell buffers at bottom of frame in dedicated window
Inspired by https://www.masteringemacs.org/article/demystifying-emacs-window-manager.
2023-02-11 19:33:19 +01:00
Daniel - 93fee67983
Remove obsolete eshell magit command
Just use `magit` directly, eshell understands this.
2022-10-13 17:22:31 +02:00
Daniel - 8b97b092c4
Allow to customize whether the eshell prompt contains the git state
Since all of this is slow on Windows, it's better to be able to disable it.

Sigh.
2022-08-31 18:43:35 +02:00
Daniel - 2b7960d427
Do not rely on / file separator in eshell git prompt 2022-08-30 19:09:10 +02:00
Daniel - 263d1af073
Try to avoid eshell git prompt calls when inside a git directory
Not sure whether this is really the right way to do it.
2022-08-30 19:06:32 +02:00
Daniel - 437ce6daff
Fix errors in eshell prompt function
To determine whether a merge is in progress, do not check in the current
directory for .git/MERGE_HEAD, but do this in the repository directory.

When computing `base-dir`, take the whole non-directory part, not just the
basename; otherwise directories like .emacs.d will get the final `.d` get
stripped off.
2022-08-30 18:51:29 +02:00
Daniel - 584480bd53
Add state information to eshell git prompt 2022-08-29 18:59:06 +02:00
Daniel - c174080d4a
Restyle git branch information in eshell prompt
Just an idea.
2022-08-27 16:38:55 +02:00
Daniel - 925a55de1e
Include base directory of current git repository in eshell prompt
This allows to see of which git repository the current working directory is part
of.

This is also included in Howard Abrams configuration, but he instead determines
the name of the current git repository by looking at `remote.origin.url`.
However, my upstream branch is not always called `origin`, and sometimes there
is no upstream repository at all.  Using the name of the current directory (not
the whole path, though) instead seems to be a good compromise from my point of
view.
2022-08-27 16:17:14 +02:00
Daniel - a6f876d4f4
Add name of current git branch to eshell prompt
Inspired by configuration from Howard Abrams, see
https://github.com/howardabrams/dot-files/blob/master/emacs-eshell.org#special-prompt.
2022-08-27 15:57:59 +02:00
Daniel - 5009eb39f9
Move eshell popup function to `db-eshell'
That's where it belongs.
2020-06-26 23:08:00 +02:00
Daniel - 501060c05a
Silence byte-compiler in `db-eshell' 2020-06-26 22:59:46 +02:00
Daniel - 2f3844856b
[eshell] Fix prompt coloring 2019-10-05 17:57:32 +02:00
Daniel - 2be4970d2a
[EShell] Fix completion for git
Search string was not up-to-date anymore, and comments behind actual commands
have changed.
2018-12-09 14:55:52 +01:00
Daniel - 3522387e90
[EShell] Show history of previous commands in order of usage 2018-11-03 12:09:54 +01:00
Daniel - 60f4a1cc0a
[EShell] Streamling configuration
Move all actual configuration to init.el, only leaving function definitions in
db-eshell.el.
2018-11-03 12:01:34 +01:00
Daniel - a38efb3133
[EShell] Add workaround for faulty completing when not ignoring case
Is this a general issue?  Should this be reported?
2018-10-20 14:54:09 +02:00
Daniel - c67255b7c5
[EShell] More prompt beautifications
Or modifications, at least.
2018-07-20 14:26:34 +02:00
Daniel - 462dd74550
[EShell] Fix wrong key bindings 2018-07-20 14:26:18 +02:00
Daniel - 631fbcfd13
[EShell] More playing around with the prompt 2018-07-19 14:30:01 +02:00
Daniel - 7640aae6f6
[EShell] Improving display and navigation of history 2018-07-19 14:02:44 +02:00
Daniel - 1d1f48e47b
[EShell] Shortcut for calling ‘magit-status’ 2018-07-19 13:50:02 +02:00
Daniel - 1126f85c6c
[EShell] Trying to make the prompt look nicer
With inspiration from Howard Abrams’ Emacs configuration
2018-07-19 13:49:26 +02:00
Daniel - 7399609194
[EShell] Set some further variables 2018-01-24 19:30:05 +01:00
Daniel - 361ee2e83d
[EShell] Citing some sources 2018-01-24 19:29:57 +01:00
Daniel - 46400826eb
[EShell] Don’t barf if git commands cannot be found 2018-01-24 19:29:42 +01:00
Daniel - 7fbc7f0217
[EShell] Don’t truncate buffer
The hook was wrong anyway.
2018-01-14 10:47:18 +01:00
Daniel - 60a3675d3e
[Misc] Use ‘with-editor’ in eshell and shell 2018-01-14 10:10:18 +01:00
Daniel - 17b5d9fecb
[Misc] Add lexical binding to all files 2017-12-03 09:19:05 +01:00
Daniel - f4c8a00a28
[EShell] Move configuration to dedicated package
Not clear whether this is a good idea, though.
2017-08-06 14:08:25 +02:00