Questions tagged [term]

is for the Emacs text terminal emulator, which by default runs in a sub-shell in a buffer named `*terminal*` with `term-mode`. `M-x term` command starts a terminal.

Filter by
Sorted by
Tagged with
0 votes
1 answer
29 views

A comparitive analysis of shell, eshell, and term: what are the similiraties? What are the differences between them? When to use each of them?

This question was previously answered in Unix Stack Exchange. It has not been answered here, in Emacs Stack Exchange. I believe new answers in a community fully dedicated to Emacs could go deeper. But ...
user avatar
1 vote
1 answer
110 views

Why does `eshell` not create an active process In Emacs while `shell` and `term` do?

In Emacs, the features shell, term, and eshell are different commands used for similar goals. When executed, shell and term create active processes in Emacs. I expected the same for eshell. However, ...
user avatar
0 votes
1 answer
23 views

How to enable terminal beeping?

xterm conviniently beeps on a failed unit test (pytest): Beeping (start-process "" nil "/usr/bin/xterm" "-e" "python3" "-B" "-m" "...
user avatar
  • 607
0 votes
2 answers
45 views

Why does htop command does not work on *shell*?

I tend to prefer shell over term. With shell everything is text and I can use the Emacs bindings to move around. Also, I have been trying to avoid opening my nixOS terminal. I have been trying to stay ...
user avatar
1 vote
0 answers
36 views

How can I change buffer local key binding C-h, C-x, M-x in term raw mode?

I'm running a specific console application in a term window (char/raw mode). This application has no need for C-h, C-x, and M-x, so they should just do what they always do in Emacs. However, I don't ...
user avatar
  • 21
0 votes
0 answers
33 views

How to have a multiple line prompt terminal?

Using mainly ansi-term,term or vterm I'd like the prompt to contain a line with informations for directory,user and git, whilst the actual input prompt line to be below. I've heard of zsh though doubt ...
user avatar
  • 607
0 votes
0 answers
32 views

How to bind term-interrupt-subjob in term-raw-map with use-package?

I am trying to bind term-interrupt-subjob in term-raw-map like this, (use-package term :bind (:map term-raw-map ("C-c". term-interrupt-subjob) ("C-'". kill-buffer))) ...
user avatar
  • 755
0 votes
1 answer
31 views

Using after-change-functions for an ansi-term buffer

I'm writing some Elisp that compiles code in watch mode using make-term. When the code compiles/tests pass, the compilation output is only a couple of lines. When there's an error, it can be much ...
user avatar
  • 101
3 votes
1 answer
137 views

How to make 'term' close the buffer when the process exits?

When I press Ctrl-D in a 'term', the buffer stays open with the text "Process terminal finished". How can I make this buffer close instead of staying open with this text displayed? Note, ...
user avatar
  • 7,179
0 votes
1 answer
34 views

How to launch 'term' with my default shell without a prompt to select the shell?

I would like to launch term with my default shell, without being prompted every time for the path of the shell. How can I bind a key to term without being prompted for the shell to run?
user avatar
  • 7,179
0 votes
0 answers
136 views

Interactive terminal solution for Emacs on Windows?

I recently tried to move from over to Emacs but hit a brick wall while trying to setup a terminal. While shell and eshell work fine, they are not really interactive so you can't really run things such ...
user avatar
  • 123
2 votes
1 answer
184 views

Prevent term from asking me which shell to use

I want to use /bin/bash as default shell for term avoiding it to ask me every time. Is this possible?
user avatar
0 votes
1 answer
107 views

How to open `crontab -e` in emacs terminal editor?

I am trying to open crontab -e in emacs terminal editor, but it keeps opening it as GUI. After running crontab -e emacs windows pops up rather than opening it as terminal editor. $ crontab -e no ...
user avatar
  • 1,066
0 votes
0 answers
27 views

Create term horizontal split that is 20% size key binding

I'd like a key binding that can create a term buffer in a 25 percent split. What I mean by that is, with a specific key binding like SPC t c, I'd like to open up a terminal in a split.
user avatar
0 votes
1 answer
77 views

What is the keycode of C-TAB?

iTerm does not send ctrl+tab itself, so I need to configure it myself. I can't figure it what key code ctrl+tab is though.
user avatar
  • 620
0 votes
0 answers
46 views

Switch Emacs default shell from bash to zsh or fish [duplicate]

When I deleted the zsh shell to move to fish, alot of my emacs configuration got messed up. It won't recognize my racer (Rust autocomplete) or do syntax highlighting. When I run doom reload, it gives ...
user avatar
1 vote
1 answer
162 views

How can I bind F12 in serial-term mode to minicom's F12?

When I use emacs serial-term mode Can I invoke F12 or other function keys as minicom's F12? I tried below... but it doesn't work (global-set-key [f12] nil) Thank you in advance!
user avatar
1 vote
1 answer
190 views

Wait for result of fzf without blocking input

I'm trying to make use of the fzf fuzzy finder to search through a list via a term process. The way I do this is very similar to fuzzy-finder.el or fzf.el. This is by launching fzf with: (progn (...
user avatar
  • 131
0 votes
1 answer
65 views

Emacs' C-tab seems without effect on my server through ssh

(Emacs 27.1) On my local machine <C-tab> is linked to other-window and works well: .emacs.d/init.el: (global-set-key (kbd "<C-tab>") 'other-window) When I install Emacs on a (...
user avatar
0 votes
0 answers
34 views

Weird UI of term in Doom

My terminal in Doom looks like shown in picture but I can't seem to find a way to solve this. I have term activated in my init.el
user avatar
2 votes
1 answer
76 views

Elisp - Changing directory in shell buffer

I want to open an instance of a terminal emulator (in my case term) and go to a specific directory, all with a single Elisp function. My idea was to send a specific string programmatically to the ...
user avatar
  • 173
0 votes
1 answer
48 views

Setting `scroll-margin` for `term-mode` using `unless` is not working

I want to set default value of scroll-margin to 3 but for ansi-term I want it to be 0. To do this I have added a hook to term-mode-hook which worked fine. (setq scroll-margin 3) ...
user avatar
0 votes
1 answer
52 views

Why does `term-emulate-terminal` get executed every time `read-from-minibuffer` gets executed?

Why does term-emulate-terminal get executed every time I execute counsel-switch-buffer if and only if the *terminal* buffer is open in a window. If the *terminal* buffer is not in a window term-...
user avatar
1 vote
0 answers
74 views

Why does calling `term-send-backspace` (just pressing backspace) create a newline in the `*terminal*` buffer in `term-mode`?

Specs: i@debord:~$ emacs --version GNU Emacs 26.3.50 Copyright (C) 2019 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the ...
user avatar
1 vote
1 answer
195 views

M-x compile hangs with WARNING: terminal is not fully functional

I have been using M-x compile for ages. Lately (our sysadmin has updated many things) it hangs after giving this message: WARNING: terminal is not fully functional - (press RETURN). Pressing return ...
user avatar
1 vote
1 answer
57 views

How to override Q in term-mode with passthrough if the shell process is still live?

I wrote the following emacs lisp procedure to kill a dead ansi-term buffer. It works well if called with M-x. Also, it appears to run correctly when the called in a living term buffer. However, dead ...
user avatar
  • 3,455
0 votes
0 answers
21 views

How to wrap visual program with term? [duplicate]

I have installed visidata and am trying to integrate into my Emacs workflow through term-mode. As a proof of concept, I'm trying to successfully explore the mtcars data set as it would work when ...
user avatar
  • 3,455
0 votes
0 answers
406 views

Python : name '__file__' is not defined

So as you can see, in my terminal, I was able to execute the file without error, but once I tried from the python shell, whether in the terminal or the one integrated in Emacs, there is an error, it ...
user avatar
1 vote
0 answers
73 views

emacs -nw & gnome-terminal or xterm: can't distinguish C-M-v and C-M-S-v

emacs (v.26.3) can distinguish, out of the box, C-M-v (scroll-other-window) and C-M-S-v (scroll-other-window-down). On the other hand, emacs -nw, when run in either gnome-terminal, mate-terminal or ...
user avatar
  • 123
0 votes
2 answers
310 views

How to get kill-buffer-hook to detach a screen session prior to kill-buffer?

I keep many screen session running in the backgroud, which I access with M-x eshell-command "screen -r <myscreen>". Before I kill the *screen* buffer, I have to detach the session with C-a d. ...
user avatar
2 votes
0 answers
34 views

How to restore a coding environment?

Every other day I continue work on a coding project which involves these steps: Open a file in the project Open a terminal buffer e.g.: m-x term Change to that term buffer Enter command in termin e.g....
user avatar
  • 607
0 votes
0 answers
422 views

How do I stop a process with Ctrl-C in Term?

I'm very new to Emacs. I've opened a terminal with M-x term, and started a server running on localhost. It says Press CTRL+c to quit. However, Ctrl-C appears to be mapped to Emacs commands. How can I ...
user avatar
0 votes
3 answers
1k views

How can I use Emacs and iTerm for the same key binding?

In my .emacs file I have also set ctrl-o to delete a word: (defun backward-delete-word (arg) "Delete characters backward until encountering the beginning of a word. With argument ARG, do this ...
user avatar
  • 1,066
0 votes
1 answer
173 views

How to quit serial-term?

I opened a serial-term to /dev/ttyUSB0. I can't quit it. C-x k results in the following message: term-quit-subjob: Process /dev/ttyUSB0 is not a subprocess
user avatar
  • 958
0 votes
1 answer
49 views

How do I open a .gpg file from the command line?

I have a file located in the directory ~/myfiles/list.txt.gpg. In the terminal, I type emacs ~/myfiles/list.txt.gpg and I get something that looks like this, which I'm guessing is the still encrypted ...
user avatar
0 votes
0 answers
181 views

Send command to run in eshell, after compiled

So I've been mapping my M-x compile like this, according to c-mode-hook or c++-mode-hook: (add-hook 'c++-mode-hook (lambda () (set (make-local-variable 'compile-command) ...
user avatar
  • 285
0 votes
0 answers
33 views

Record command into bash source block using asciinema and org-babel

As you perhaps know, asciinema rec (asciinema rec path/to/file) and generate an asciicast file which contain all commands recorded on terminal. I think using asciinema to replay this file (asciinema ...
user avatar
0 votes
1 answer
128 views

How to show colours and clear when running React development server in eshell?

Here is how the usual Ubuntu terminal looks when you run the React development serving using npm start and make changes to your source: Say the server was already running and you tried to do npm ...
user avatar
  • 755
1 vote
0 answers
59 views

How to make ansi-term wrap lines instead of adding newline so it can fit the window?

See the screenshot. I typed one long line in the buffer, didn't hit enter but cursor is already on line 3. This causes multiple problems, eg. when I copy the output of a command from ansi-term to ...
user avatar
1 vote
0 answers
127 views

Truncation of text in Emacs terminal emulators

When I log in to the cluster using shell or eshell, I get the following message: 2018-04-11: The MEM1024 node is now back in the queue. The hardware had to be completely replaced, which means there ...
user avatar
0 votes
0 answers
54 views

Is there a pexpect like automation for serial-term or term-mode

Is there something similar to pexpect that can be used to automate a tty connection running inside emacs, i.e. in term-mode or on top of serial-term ? I'd like to automate some repetitive tasks like ...
user avatar
1 vote
0 answers
91 views

In emacs term-mode (not shell-mode), how can we edit a command just like we type C-x C-e in real terminal

In real terminal, if we type C-x C-e, we can edit a typed command using an editor. Could have similar function in emacs term-mode? After typing a shortcut, I would like to edit the current command ...
user avatar
  • 959
0 votes
0 answers
114 views

C-r in term-mode doesn't access reverse-i-search

I find that in term-char-mode with bash, C-r doesn't activate the shell's reverse-i-search function. How can I do that? PS. Apologies: I was using multi-term mode and had somehow convinced myself ...
user avatar
  • 2,924
2 votes
1 answer
305 views

How to launch term at startup in Emacs?

I need to have Emacs open a terminal at start-up automatically (in order to use Fish in the terminal and use Emacs to for example search the Fish output). Normally I do this with 'M-x term'. Is ...
user avatar
3 votes
2 answers
2k views

Howto display unicode character \u2026 in terminal mode in emacs

Magit uses Horizontal Ellipsis unicode escape "\u2026" (which should display as "...") to mark hidden section. How can I configure the Terminal/Emacs to display them when running in terminal mode (...
user avatar
4 votes
2 answers
608 views

Cargo-process does not accept user input

Using the Emacs mode for Cargo, I'm able to build and run Rust code inside Emacs. However, the terminal that opens when executing cargo-process-run does not accept user input. For example, when ...
user avatar
  • 171
0 votes
1 answer
554 views

Set different highlight-line color for emacs --no-window

How can I set a different color if I am using emacs on terminal (emacs --no-window)? I use a grey highlight line when using emacs with GUI because my background theme is white. Here is the code I use ...
user avatar
  • 305
1 vote
1 answer
185 views

Can emacs be configured to support more terminals?

I recently switched from rxvt-unicode to st. This means I went from $TERM=rxvt-unicode-256color to $TERM=st-256color. I'm happy with the switch and want to continue to use st. However, I quickly ...
user avatar
3 votes
2 answers
895 views

How to make M-x ansi-term behave like M-x shell (opening in new window)?

I use (global-set-key (kbd "C-c a") '(lambda () (interactive) (ansi-term "/bin/bash"))) to open a bash ansi-term. Unlike M-x shell, this "occupies" the whole buffer/frame. I am wondering if one ...
user avatar
1 vote
1 answer
115 views

Interactive lambda only calls 1 of several functions called in body

In term-mode I've configured the keybindings for term-line-mode and term-char-mode as follows: (setq term-bind-key-alist (list (cons "C-c C-j" '(lambda () (interactive) ...
user avatar
  • 167