You are not logged in.

#1 2016-01-11 01:03:52

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Launching terminal from commandline gives "wrong" terminal [SOLVED]

If I write "xterm" in my shell, a terminal window with none of my config files loaded (plain white, says "sh-4.3$"). My zshrc file has not loaded in this case (as my aliases aren't working).

If I launch a terminal from i3wm's standard hotkey (Mod1+return), xterm is loaded perfectly.
If I launch a terminal from rofi (program launcher), xterm is loaded perfectly.

What is going on here?
If relevant, echo $TERM gives xterm-256color.

Last edited by grindv1k (2016-01-11 22:55:55)

Offline

#2 2016-01-11 01:07:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

What does `type xterm` return?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-01-11 13:22:21

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

jasonwryan wrote:

What does `type xterm` return?

Output:
"xterm is /usr/bin/xterm".

Offline

#4 2016-01-11 15:13:15

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

Are you launching xterm as your user (and not with sudo/as root)?


pkgs │ hacks │ cfg │ blag

Offline

#5 2016-01-11 22:28:30

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

ayekat wrote:

Are you launching xterm as your user (and not with sudo/as root)?

No, I am launching it via my user.
I tried launching via sudo, and the result was the same, except the prompt now showed up as
"root@<hostname>", instead of
"sh-4.3$".

Offline

#6 2016-01-11 22:34:53

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

grinv1k wrote:

If I launch a terminal from i3wm's standard hotkey (Mod1+return), xterm is loaded perfectly.
If I launch a terminal from rofi (program launcher), xterm is loaded perfectly.

Could you please open a "correctly" running xterm (e.g. through the launcher) and an "incorrectly" running xterm (launched from the command line), then post the output of this?

ps aux xterm

pkgs │ hacks │ cfg │ blag

Offline

#7 2016-01-11 22:44:56

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

Grasping at straws, but maybe your default shell is misconfigured or unconfigured and terminals launched otherwise are using some other configuration than /etc/passwd ?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2016-01-11 22:46:22

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

ayekat wrote:
grinv1k wrote:

If I launch a terminal from i3wm's standard hotkey (Mod1+return), xterm is loaded perfectly.
If I launch a terminal from rofi (program launcher), xterm is loaded perfectly.

Could you please open a "correctly" running xterm (e.g. through the launcher) and an "incorrectly" running xterm (launched from the command line), then post the output of this?

ps aux xterm

Tried having both up side by side, both times starting with a "correct xterm". First time typing "xterm" which launches a "wrong" xterm while the first is busy, second time typing "xterm &" so I could write input on the correct xterm. Lastly I tried the command from just a single "correct" xterm.
Anyway the output was the same each time:

$ ps aux xterm
error: TTY could not be found

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

Offline

#9 2016-01-11 22:52:01

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

alphaniner wrote:

Grasping at straws, but maybe your default shell is misconfigured or unconfigured and terminals launched otherwise are using some other configuration than /etc/passwd ?

Maybe? The output of "printenv" lists:

TERM=xterm-256color

Which I can't remember setting anywhere else than in .Xresources by:

xterm*termName: xterm-256color

It also mentions

XTERM_SHELL=/usr/bin/zsh

but there is no mention of just "SHELL". Is this configuration wrong?

EDIT: Thanks! I added this to my .zshrc

SHELL=/usr/bin/zsh

, and ran

source ~/.zshrc

Now it works! Typing "xterm" from my terminal now opens a "correct" version. Solved.

Last edited by grindv1k (2016-01-11 22:55:09)

Offline

#10 2016-01-11 22:53:48

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

I'm sorry, that should have been

ps aux | grep xterm

pkgs │ hacks │ cfg │ blag

Offline

#11 2016-01-11 22:55:21

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

grindv1k wrote:

The output of "printenv" lists:

TERM=xterm-256color

Which I can't remember setting anywhere else than in .Xresources by:

xterm*termName: xterm-256color

Remove that line from .Xresources

Let the terminal set that variable.

EDIT: Oh, you solved it.

Last edited by Head_on_a_Stick (2016-01-11 22:56:11)


Jin, Jîyan, Azadî

Offline

#12 2016-01-11 23:07:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

grindv1k wrote:

I added this to my .zshrc

SHELL=/usr/bin/zsh

, and ran

source ~/.zshrc

Now it works! Typing "xterm" from my terminal now opens a "correct" version. Solved.

This isn't a fix, it is a workaround. I think alphaniner is right, your shell is misconfigured. How did you change to Zsh?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2016-01-12 08:03:16

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

jasonwryan wrote:
grindv1k wrote:

I added this to my .zshrc

SHELL=/usr/bin/zsh

, and ran

source ~/.zshrc

Now it works! Typing "xterm" from my terminal now opens a "correct" version. Solved.

This isn't a fix, it is a workaround. I think alphaniner is right, your shell is misconfigured. How did you change to Zsh?

Interesting. I remember installing Zsh via pacman.  I later also installed oh-my-zsh via github which I am guessing you know of.
I also ran the "initial setup wizard" at some point, which I think starts on the first Zsh run.
At some point I believe I ran the two commands from this part of the wiki: https://wiki.archlinux.org/index.php/Co … ault_shell which was linked from the Zsh article.

$ chsh -l
$ chsh -s full-path-to-shell

Offline

#14 2016-01-12 08:07:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

I would look at what OMZ has done with it's setup: something is definitely not right if you have to export that var to get a sane environment...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#15 2016-01-12 08:42:19

grindv1k
Member
Registered: 2015-11-15
Posts: 21

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

jasonwryan wrote:

I would look at what OMZ has done with it's setup: something is definitely not right if you have to export that var to get a sane environment...

OK. For future reference, if I was to install Arch fresh and wanted to change shell, would I have to do anything other than installing the shell (pacman/aur) and running the two commands mentioned above?
That is

$ chsh -l
$ chsh -s full-path-to-shell

Offline

#16 2016-01-12 08:54:39

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

Nope: that is all you need to do (which is why I suspect OMZ has broken something).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#17 2016-01-12 10:11:03

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Launching terminal from commandline gives "wrong" terminal [SOLVED]

The reason why I asked for getting the list of all xterm processes was to find out whether OP is running xterm as a login shell in some cases (and whether perhaps OMZ has somehow set up its stuff in .zlogin/.zprofile instead of .zshrc).

Scratch that, he says it works fine after sourcing .zshrc.

EDIT OK, but still, what are the command lines for each xterm process?
Also, is the ZDOTDIR environment variable set, and if yes to what value?

Last edited by ayekat (2016-01-12 10:32:53)


pkgs │ hacks │ cfg │ blag

Offline

Board footer

Powered by FluxBB