I'm using nodejs-repl, though the question applies to sending text to any repl.

I'd like to send a buffer to the repl, which I do with C-c C-b, but I don't want the buffer text to show in the prompt.

So instead of this:

> 0 + 1
> const seven = require('./seven);
const five = require('./five');
const add = require('./add');

const twelve = add(seven, five);


I would instead something like see:

> 0 + 1
> loaded path/to/file.js

The loaded path/to/file.js isn't required, I basically just don't want to see all the buffer text.

I'm new to elisp and so all I can think to do is store the buffer text to a variable and somehow only show that variable (I don't know how to do this though).

1 Answer 1


This example sends the command to the shell buffer, and displays the results but without displaying the command:

  (let* ((buf (get-buffer "*shell*"))
     (proc (get-buffer-process buf))
     (command "echo hello world\n"))
(comint-send-string proc command)

I think the same approach would work with any comint buffer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.