I use minitest-mode which starts Ruby tests in compilation-mode
:
(compilation-start
actual-command
'minitest-compilation-mode
(lambda (arg) (minitest-buffer-name (or file-name ""))))
Tests invoke psql
program, and it thinks like it's running in interactive terminal, so it outputs some of its output through pager (less
). Because compilation-mode
buffer is not a real interactive terminal, I can't press keys to close less
and continue, so test process freezes and requires killing.
Is it possible to make compilation-mode
run program in non-interactive terminal (as I understand, it should not allocate pty)? When looking at ps
output, it looks like it has its own tty:
18046 ttys004 0:02.51 ruby -Ilib:test:spec test/functional/ads_controller_test.rb
18063 ttys004 0:02.41 ruby bin/rails db:test:prepare
TIOCGWINSZ
ioctl, sopsql
decides to run pager regardless of output size.actual-command
to besh -c "actual-command"
. Unlesssh
is called with-i
flag, it will not allocate tty and whatever other programs it will run will not try to second-guess you about pagers etc. Also, something I find myself doing quite often in this situation is runningactual-command | cat
, which also disables pagers.comint-mode
allows to interact with terminal, I didn't know about this possibility.TERM
is set todumb
.sh -c
didn't disable paging, but| cat
disabled it successfully. In both cases, underlying command (ruby
) had tty.