You are not logged in.
Is there a command I can run to make sure that my entry to export my default terminal as "rxvt-unicode" is working?
I've recently updated urxvt to another package and I'd like to know that my export is working as it should.
Offline
Run "echo $TERM"?
Offline
What I mean is, how do I know the export is working for what it is intended? How can I figure out that "export TERM=rxvt-unicode" is actually doing its job?
e.g. opening a URL from the terminal shows that that "export BROWSER=firefox" is doing its job because it opens the URL in Firefox.
Last edited by sensory (2011-07-22 00:54:13)
Offline
Why do you export it? Do you want to do something that expects $TERM to be rxvt-unicode?
[karol@black ~]$ echo $BROWSER
/usr/bin/firefox
It's just a variable so it gets substituted by the shell when interpreting the command you gave.
If /usr/bin/firefox is a symbolic link to e.g. chromium, the url will open in chromium, but the $BROWSER variable works OK.
Last edited by karol (2011-07-22 01:04:38)
Offline
Is there a command I can run to make sure that my entry to export my default terminal as "rxvt-unicode" is working?
I've recently updated urxvt to another package and I'd like to know that my export is working as it should.
Do not do this, never export TERM ever.
Just throw "URxvt*termName: rxvt-unicode-256color" or similar into your ~/.Xdefaults instead.
As for seeing if it works:
Run "echo $TERM"?
Last edited by Mr.Elendig (2011-07-22 12:46:01)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
As for seeing if it works:
lucke wrote:Run "echo $TERM"?
Of course, that's not exactly a sufficient condition.
$ unset i
$ i=hello
$ echo $i
hello
$ bash <(echo echo \$i)
$ export i
$ bash <(echo echo \$i)
hello
Just to clarify a bit...
This silver ladybug at line 28...
Offline
Mr.Elendig wrote:As for seeing if it works:
lucke wrote:Run "echo $TERM"?
Of course, that's not exactly a sufficient condition.
$ unset i $ i=hello $ echo $i hello $ bash <(echo echo \$i) $ export i $ bash <(echo echo \$i) hello
Just to clarify a bit...
...and the point of this exercise is that child processes don't inherit environment vars which aren't exported. So the proper check might be:
$ declare -p TERM # bash specific
declare -x TERM="rxvt-unicode-256color"
$ grep -z ^TERM= /proc/self/environ # shell agnostic
The '-x' flag is what you're looking for in the Bash case.
Last edited by falconindy (2011-07-22 15:09:01)
Offline
...and the point of this exercise is that child processes don't inherit environment vars which aren't exported. So the proper check might be:
$ declare -p TERM # bash specific declare -x TERM="rxvt-unicode-256color"
The '-x' flag is what you're looking for in the Bash case.
For exports, `export -p' also does the job. e.g.,
$ export -p | grep 'declare -x TERM'
`export -p' is a little more accurate in that it also reports a exported environment variable even f it's not set a value.
> Edit: Hmm, `declare -p' without an operand does also report the such environment variables too. Oh well.
$ grep -z ^TERM= /proc/self/environ # shell agnostic
Although this is totally weird and uses an external program, I admire you.
Last edited by lolilolicon (2011-07-22 16:00:53)
This silver ladybug at line 28...
Offline
Do not do this, never export TERM ever.
Why shouldn't I export TERM? I've always been told the opposite.
Thanks for all the replies; I'll check out all your suggestions when I'm at my computer.
Offline
Mr.Elendig wrote:Do not do this, never export TERM ever.
Why shouldn't I export TERM? I've always been told the opposite.
Thanks for all the replies; I'll check out all your suggestions when I'm at my computer.
You for some reason run a different terminal but don't change the TERM export. Enjoy your broken apps / messed up terminal.
Generally a good idea to let the terminal itself say what it is...
Last edited by Mr.Elendig (2011-07-22 16:59:27)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
You for some reason run a different terminal but don't change the TERM export. Enjoy your broken apps / messed up terminal.
Generally a good idea to let the terminal itself say what it is...
That's not really an answer..
Offline
How is that not an answer? Libraries such as ncurses depend on the term name to figure out terminal capabilities (man terminfo) and the proper escape sequences to send. If you change this, you change the way applications behave.
TERM=dumb <insert ncurses app>
Offline
Mr.Elendig wrote:You for some reason run a different terminal but don't change the TERM export. Enjoy your broken apps / messed up terminal.
Generally a good idea to let the terminal itself say what it is...That's not really an answer..
Well, it is, but I'll try to answer in a somewhat different way.
Different terminals(the "device") provide different interfaces/capabilities to applications. So sometimes some applications need to know which terminal they're running on. They may rely on the TERM environment variable to determine this. This is why terminals should always set the correct TERM environment. (The terminfo(5) man page should be of great help on this topic.) This is also why setting and exporting the TERM environment in your shell startup script (e.g., ~/.bashrc) is a bad idea, since it will always override the (supposedly correct) TERM environment set by the terminal itself and blindly set the TERM variable to an arbitrary value -- it's like labeling all toilets around the world as "women"
No, let the toilet say what sex it is. Men need somewhere to pee.
This silver ladybug at line 28...
Offline
How is that not an answer? Libraries such as ncurses depend on the term name to figure out terminal capabilities (man terminfo) and the proper escape sequences to send. If you change this, you change the way applications behave.
TERM=dumb <insert ncurses app>
Because the reply wasn't informative. You can tell someone not to do something but if you don't inform them why it's bad to do so, you're not helping. Your reply on the other hand was informative and helpful, so thank you for that.
Well, it is, but I'll try to answer in a somewhat different way.
Many thanks for taking the time to explain all that. I really appreciate the information.
Offline