LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'Clear' command not working. (https://www.linuxquestions.org/questions/linux-newbie-8/clear-command-not-working-4175582643/)

Orkel 06-20-2016 12:24 AM

'Clear' command not working.
 
I was working in a screen session and clear was working fine. When I exited out of the screen session, clear would give me this error.


Code:

'rxvt-unicode': unknown terminal type.
It also happens if I use it in a bash script.

Code:

#!/bin/bash

clear

exit

It works when i use another terminal emulator, such as xterm. It also works when i ssh from urxvt, it also works when I use screen in urxvt.

I have tired updating, removing then reinstalling, and purging and reinstalling.

CTRL+l works to clear the screen also.

Sayan Acharjee 06-20-2016 12:39 AM

Follow the instructions on these links, check if the works

https://dimit.me/blog/2015/01/28/urx...m-support-ssh/
http://alemani.com/urxvt-unknown-ter...type-with-ssh/

Orkel 06-20-2016 12:52 AM

I have already googled and looked at these sites. They fix the problem of starting a ssh session to a server and then the 'clear' command being a issue. I'm having the issue with the 'clear' command not working on the host machine.

I also just checked if one of my bash scripts would work and it seems the 'tput' command doesn't work either, returns the same error.

Sayan Acharjee 06-20-2016 12:58 AM

Okay, it's better to use absolute path in the script and check again.
/usr/bin/clear

Orkel 06-20-2016 01:01 AM

Same error code. It works fine with other terminal emulators, I think its a problem with urxvt in some way.

Sayan Acharjee 06-20-2016 01:07 AM

Is "echo $TERM" shows the same output from script as it is from outside? You might need to define the TERM variable in the script itself.

Orkel 06-20-2016 01:10 AM

The value of $TERM is 'rxvt-unicode' same as within a script. But it happens when i'm just in a terminal emulator too.

Sayan Acharjee 06-20-2016 01:25 AM

Have you manually change the $TERM in your .basrc or any of the initialization scripts like .profile, .bash_profile? The terminal identification string should always be sent by the terminal emulator you are using, because this sometimes causes conflict.

Do check the below link and read from the section "Finding appropriate terminfo(5) definitions", this might help

https://sanctum.geek.nz/arabesque/tag/terminfo/

Orkel 06-20-2016 01:33 AM

I have not changed the $TERM variable, ever. And the $TERM value is as it should be, 'rxvt-unicode' for the urxvt terminal emulator. Correct me if i'm wrong.

Sayan Acharjee 06-20-2016 01:34 AM

Okay, Do check the below link and read from the section "Finding appropriate terminfo(5) definitions", this might help

https://sanctum.geek.nz/arabesque/tag/terminfo/

Sayan Acharjee 06-20-2016 01:43 AM

Also try installing ncurses-term package if it's not there. This will add the definition files so it shouldn't show anymore unknown terminal error.

Orkel 06-20-2016 02:02 AM

I read the page that was linked, and I feel it just made things more confusing. Here is the command I used to see the definition of terms.

Code:


orkel@AzuraD:~$ locate terminfo | grep -i -E 'rxvt-unicode*'                 
/lib/terminfo/r/rxvt-unicode
/usr/share/terminfo/r/rxvt-unicode-256color

So if I understand this correctly, the definition for the urxvt terminal is there, I have tires using both unicode variants, and still gives the error.

And just a update...I tried to ssh into the host machine from urxvt and got the same error when trying to use the 'clear' command.

When I use screen, ssh or not, I can use 'clear' and 'tput'. And when I check the value of $TERM I get 'screen'

Orkel 06-20-2016 02:04 AM

I read the page that was linked, and I feel it just made things more confusing. Here is the command I used to see the definition of terms.

Code:


orkel@AzuraD:~$ locate terminfo | grep -i -E 'rxvt-unicode*'                 
/lib/terminfo/r/rxvt-unicode
/usr/share/terminfo/r/rxvt-unicode-256color

So if I understand this correctly, the definition for the urxvt terminal is there, I have tires using both unicode variants, and still gives the error.

And just a update...I tried to ssh into the host machine from urxvt and got the same error when trying to use the 'clear' command.

When I use screen, ssh or not, I can use 'clear' and 'tput'. And when I check the value of $TERM I get 'screen'


All times are GMT -5. The time now is 03:24 PM.