LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2016, 12:24 AM   #1
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Rep: Reputation: Disabled
'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.
 
Old 06-20-2016, 12:39 AM   #2
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
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/
 
Old 06-20-2016, 12:52 AM   #3
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-20-2016, 12:58 AM   #4
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Okay, it's better to use absolute path in the script and check again.
/usr/bin/clear
 
Old 06-20-2016, 01:01 AM   #5
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: Disabled
Same error code. It works fine with other terminal emulators, I think its a problem with urxvt in some way.
 
Old 06-20-2016, 01:07 AM   #6
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
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.
 
Old 06-20-2016, 01:10 AM   #7
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: Disabled
The value of $TERM is 'rxvt-unicode' same as within a script. But it happens when i'm just in a terminal emulator too.
 
Old 06-20-2016, 01:25 AM   #8
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
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/

Last edited by Sayan Acharjee; 06-20-2016 at 01:33 AM.
 
Old 06-20-2016, 01:33 AM   #9
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-20-2016, 01:34 AM   #10
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
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/
 
Old 06-20-2016, 01:43 AM   #11
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
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.
 
Old 06-20-2016, 02:02 AM   #12
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: Disabled
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'
 
Old 06-20-2016, 02:04 AM   #13
Orkel
LQ Newbie
 
Registered: Jun 2016
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: Disabled
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'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] clear command sabsac Linux - Newbie 18 10-08-2015 05:21 PM
clear command is not working mq15 Linux - Newbie 4 04-25-2009 10:27 PM
clear command sud Linux - Newbie 1 04-23-2009 01:54 AM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM
Always clear last command GUIPenguin Linux - General 3 09-14-2004 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration