texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.79k stars 343 forks source link

`tput` error message occurs when compiling with `shell-escape` #143

Closed FloMiLe closed 6 years ago

FloMiLe commented 6 years ago

tput error message occurs when compiling with shell-escape. I need this in order to take full advantage of the standalone package.

Environment

Expected behavior

Upon compiling with LuaLaTeX and -shell-escape in the compile command, no error should be thrown.

Actual behavior

the following error is thrown, even though everything seems to work normally:

tput: No value for $TERM and no -T specified

How to reproduce

Add -shell-escape to the LuaLaTeX compile command:

/Library/TeX/texbin/lualatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex

Compile a file.

FloMiLe commented 6 years ago

I just checked: Using pdfLaTeX with the command below does not cause this error message.

"/Library/TeX/texbin/pdflatex" -synctex=1 -interaction=nonstopmode -shell-escape %.tex
timhoffm commented 6 years ago

The commands in TeXstudio are executed directly and not within a shell. Probably this will be the cause of the error, though I don't know how tput is involved here.

You may wrap the command in a shell. See the user manual

j-rahman commented 3 years ago

Why is this issue closed? This bug still exists. I am using TeXStudio 3.1.2 on macOS 11.5.2. I have the following command saved.

sh -c "export TERM=xterm-256color && mkdir -p .temp & lualatex -shell-escape -synctex=1 -interaction=nonstopmode -output-directory=.temp %.tex && cp .temp/%.pdf %.pdf"

Once compiled, I get the same error message as the OP (only for LuaLaTex, not pdfLaTeX).

tput: No value for $TERM and no -T specified

How do we fix this?

muzimuzhi commented 3 years ago

@j-rahman Hi, I am using texstudio 4.0.0beta2 with basictex distribution on macOS 11.5.2, and I see no errors executing

# either
/Library/TeX/texbin/lualatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex
# or just
lualatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex

Btw, since texstudio replaces % with a quoted filename without extension, sh -c "lualatex %.tex" will expand to sh -c "lualatex "main".tex", which seems to be wrongly quoted.

Update: Using '?m)'.tex / '?m)'.pdf instead of %.tex / %.pdf works. I tried to get \"main\".tex but \\"?m)\\".tex expands to triple quotes \"""main""".tex.

j-rahman commented 3 years ago

@muzimuzhi The quotations are not a problem. I have exactly the same command set up with pdflatex as well, which throws no complaints. lualatex finishes the compilation and produces a pdf stating that the Process exited normally, but in addition to that, it also yells out tput: No value for $TERM and no -T specified which behaviour is absent with pdflatex.

Perhaps you should try to replicate this using TeXStudio 3.1.2 instead of the beta. Also, I have the MacTeX-2021 distribution installed, if that matters.

muzimuzhi commented 1 year ago

Update from 2023. With texstudio v4.5.2beta4 installed on macOS 12.6.3, I have to explicitly set TERM.

% !TeX program = sh -c "export TERM=xterm-256color && lualatex -shell-escape %.tex"
evangelosR commented 1 year ago

In Linux, changing Exec=texstudio %F to Exec=env TERM=screen-256color texstudio %F in /usr/share/applications/texstudio.desktop sets $TERM and then compiling with LuaLaTeX and -shell-escape does not return an error (I had this when trying to convert eps files using epstopdf