6

The bi-directional text support introduced in Emacs 24 interacts badly with term.el when large numbers of spaces or tabs are inserted, and many applications clear the screen (often drawing a new background colour) by writing WIDTHxHEIGHT spaces (which, if the terminal’s dimensions are sufficiently large, may take several seconds). The workaround is to ...


6

I believe that the @ symbols in your terminfo example are part of the Texinfo markup, rather than part of the terminfo code. Your terminfo entry should look like: # Use colon separators. xterm-24bit|xterm with 24-bit direct color mode, use=xterm-256color, setb24=\E[48:2:%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm, setf24=\E[38:2:%...


3

If you run bash in a term buffer, bash will do all of its normal bash initialisation things, just as it would when you run it inside any other terminal emulator. So you can set your prompt in your ~/.bashrc file, no differently to the way you do it without Emacs. If you particularly wish to detect that the shell is running inside Emacs (in order to set ...


3

i had to fiddle with it for a while, but here's a working version of Gilles's answer. just stuff this at the end of your ~/.config/fish/config.fish. # emacs dir tracking if [ -n "$INSIDE_EMACS" ] function prompt_AnSiT -e fish_prompt printf "\eAnSiTc %s\n" "$PWD" end printf "\eAnSiTu %s\n" "$USER" end the relevant differences are... this uses ...


3

The problem here is that Emacs is moving the cursor position in the buffer, but no input is being sent to the process running in the terminal, meaning that the apparent state does not match the actual state. This should be reported as a term-char-mode bug, but you can fix it by binding the Ctrl- and Meta-modified left and right cursor keys in term-raw-map ...


2

You could try the procfs approach. If you'd use the shell command, this should work. (defun shell-procfs-dirtrack (str) (prog1 str (when (string-match comint-prompt-regexp str) (let ((directory (file-symlink-p (format "/proc/%s/cwd" (process-id (get-buffer-...


2

You can set term-char-mode-point-at-process-mark to nil to disable this behaviour, otherwise it's not possible to write a command to circumvent it because the point is moved back after the command is run. This is mentioned in etc/NEWS of Emacs 26 (emphasis added): *** 'term-char-mode' now makes its buffer read-only. The buffer is made read-only to ...


1

(define-key term-raw-map (kbd "Q") #'terminal-burn-when-dead-or-insert-Q) That's definitely not going to do what you wanted it to in char mode. You need to send something to the process (like the regular binding term-send-raw does), not just insert some text into the buffer (which tells the process nothing). It's also not clear from the question ...


1

As I noted in the comment, this was actually a piece of cake using ivy-read. It's now available on https://github.com/tautologyclub/counsel-term-history


1

Add (term "/bin/bash") right after what you already have, and that worked on my setup. So you have: (split-window-vertically) (other-window 1) (term "/bin/bash") Your Emacs should start with (probably) the *scratch* buffer on top, and a term-mode window in a bash shell on the bottom, and your cursor at the command prompt.


1

Refer to the duplicate question on StackOverflow: automatically disable a global minor mode for a specific major mode This was converted to a comment when it's a perfectly sensible answer (seeing as how we can't close for duplication across SE sites), so this text is just to prevent that from happening...


1

In Term mode, you can use Term mode's own directory tracking feature. I can't find it documented in the manual. There is some example code in the source code. The program running in the terminal can emit escape AnSiT sequences to notify the terminal about its location: \eAnSiTc ${PWD}\n to indicate the current directory \eAnSiTh ${HOSTNAME}\n to indicate ...


Only top voted, non community-wiki answers of a minimum length are eligible