1

I am learning Emacs and I would like to know how to get rid of the Emacs Welcome to the Emacs shell and eshell/clear messages when I open a new eshell.

I used this question to start an eshell at startup and this question to add a clear command similar to that of Terminal. In my .zshrc I add a file called .hushlogin to mute the default message.

Now I would like for when I boot up Emacs, the two messages that print at the beginning of an eshell buffer to not appear.

I noticed when I source my init file, all of the functions print as well.

This is a screenshot of what appears any time I create a new eshell enter image description here

My .emacs file is below if that helps as well

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes '(tango-dark))
 '(inhibit-startup-screen t)
 '(markdown-command "/usr/local/bin/pandoc")
 '(package-selected-packages '(pandoc markdown-mode)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(setq default-directory "~/") (setq command-line-default-directory "~/")

(require 'package) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) (package-initialize)

(setq markdown-split-window-direction 'right)

;Start new Emacs window with eshell (add-hook 'emacs-startup-hook 'eshell)

This is my eshell-rc-script as well if that helps

alias emacs 'find-file $1'

#Clear the eshell buffer. (defun eshell/clear () (let ((eshell-buffer-maximum-lines 0)) (eshell-truncate-buffer)))

NickD
  • 29,717
  • 3
  • 27
  • 44
Jav Solo
  • 131
  • 7
  • Customize eshell-banner-message to get rid of the Welcome message. – NickD Jul 16 '21 at 01:13
  • Ok, I can see how I customize that. Thanks! Any idea how to get rid of the function names printing when sourcing a file? – Jav Solo Jul 16 '21 at 12:08
  • That's the return value of the defun form. Just like entering (+ 1 2) prints the return value 3, entering (defun foo ...) prints the return value foo. – phils Jan 25 '24 at 05:17

2 Answers2

0

I found a way of doing this that will easily get the results I want. By simply inserting a call to the clear function in my eshell-rc-script to run the command right after, it will clear the screen and both messages no longer appear. The line I added was

eshell/clear
Jav Solo
  • 131
  • 7
0

In Emacs 29.1, you can set the opening message to a blank string with (setq eshell-banner-message "").

Dan
  • 32,980
  • 7
  • 102
  • 169