Change Matlab Command Window Terminal Type?

20 Ansichten (letzte 30 Tage)
Ian
Ian am 21 Sep. 2012
Hi, I want to run a command (git log -1) via system(), but the problem is that it complains:
>> system('git log -1')
WARNING: terminal is not fully functional
- (press RETURN)
The problem is Matlab will completely freeze if this is run in a script because the command expects RETURN to be pressed before proceeding. The Matlab command window is "dumb":
>> !echo $TERM
dumb
You can test this without git installed:
>> !less --help
WARNING: terminal is not fully functional
@/\less/\help/\file/\@ (press RETURN)
Does anyone know of a way to change the TERM setting or programatically stop the (press RETURN) hanging Matlab when run in a script.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 21 Sep. 2012
Assuming you are not using MS Windows, and that your shell is not csh:
system('TERM=ansi git log -1')
or equivalently,
system('export TERM=ansi; git log -1')
  1 Kommentar
Ian
Ian am 25 Sep. 2012
Yes, that works, I had tried setting TERM but as a preceding system call which didn't work. Thanks a lot Walter!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Source Control Integration finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by