LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Question about xterm $HOME (https://www.linuxquestions.org/questions/centos-111/question-about-xterm-%24home-4175598660/)

bodisha 01-31-2017 03:16 PM

Question about xterm $HOME
 
Hello and thanks in advance for any assistance anyone can offer me

The fast & dirty question is... Could someone please tell me which file would open an xterm session into $HOME/Desktop instead of /$HOME?

The longer version is.... I was reading about login scripts when I noticed my SSH sessions logged into $HOME while my xterm session on the console logged into /$HOME/Desktop. Initially I figured I'd find something in either the /$HOME/.bashrc, /etc/bashrc, or /etc/profile to explain it.... Which I didn't find. I figured it must be specific to something xterm is doing so I looked through .xinitrc but didn't have any luck there either. I've spent half the day trying to figure out what puts an xterm session into /$HOME/Desktop but I'm having zero luck and my OCD is going crazy about it.

Thanks!

wpeckham 01-31-2017 03:44 PM

Quote:

Originally Posted by bodisha (Post 5663019)
Hello and thanks in advance for any assistance anyone can offer me

The fast & dirty question is... Could someone please tell me which file would open an xterm session into $HOME/Desktop instead of /$HOME?

The longer version is.... I was reading about login scripts when I noticed my SSH sessions logged into $HOME while my xterm session on the console logged into /$HOME/Desktop. Initially I figured I'd find something in either the /$HOME/.bashrc, /etc/bashrc, or /etc/profile to explain it.... Which I didn't find. I figured it must be specific to something xterm is doing so I looked through .xinitrc but didn't have any luck there either. I've spent half the day trying to figure out what puts an xterm session into /$HOME/Desktop but I'm having zero luck and my OCD is going crazy about it.

Thanks!

Actually, SSH is dropping you into your $HOME because that is the correct logon behavior. Your GUI (XWinodws WM) is dropping you into its current default location ( $HOME/Desktop) because it is not configured properly to NOT do that. This is common, and harmless. The .xinitrc would be the correct KIND of place to look, but I have never changed that behavior so I have never bothered to look it up for any particular WM or xterm client. It is not clear to me what WM you are using, and many of them configure this differently anyway.

One thing you might try is using the line
Quote:

cd ${HOME}
at the tail end of your .bash_profile and see if that helps.

Let me know, here, if it does.

bodisha 02-01-2017 02:03 PM

Thanks for the quick reply... I appreciate it!

Entering 'cd ${HOME}' into the .bashrc certainly works. I was trying to get more of an understanding of why a Gnome 3 shell was opening a session to $HOME/Desktop than $HOME though. I wound up loading Centos 5 & 6, as well as Fedora & Scientific Linux and the problem was happening on all of them except Centos 5.


After scouring the Internet I stumbled across a fix using the gconftool-2 utility.

As a user, run following command to change the behavior immediately:
$ gconftool-2 --set --type=bool /apps/nautilus-open-terminal/desktop_opens_home_dir true

As root, run below command to set the default behavior, which will be source when new users first log in:
# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/nautilus-open-terminal/desktop_opens_home_dir true


The explanation that was mentioned stated for some reason Gnome 3 isn't implemented correctly. Which really surprises me considering it's been out there for a while. I'm not completely satisfied with the workaround I found (I'm still convinced there's a setting buried somewhere deep in the O/S'es that fix this) but at least I can point to Gnome as the problem instead of saying "I don't know". I am left with wondering if this happens on Red Hat as well.

Anyway... Thank you for taking the time to read my my post and respond.

goumba 02-01-2017 02:54 PM

Quote:

Originally Posted by bodisha (Post 5663566)
Thanks for the quick reply... I appreciate it!
After scouring the Internet I stumbled across a fix using the gconftool-2 utility.

As a user, run following command to change the behavior immediately:
$ gconftool-2 --set --type=bool /apps/nautilus-open-terminal/desktop_opens_home_dir true

As root, run below command to set the default behavior, which will be source when new users first log in:
# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/nautilus-open-terminal/desktop_opens_home_dir true


The explanation that was mentioned stated for some reason Gnome 3 isn't implemented correctly. Which really surprises me considering it's been out there for a while. I'm not completely satisfied with the workaround I found (I'm still convinced there's a setting buried somewhere deep in the O/S'es that fix this) but at least I can point to Gnome as the problem instead of saying "I don't know". I am left with wondering if this happens on Red Hat as well.

Anyway... Thank you for taking the time to read my my post and respond.

The GNOME team tends to break things on every minor release, I wouldn't be surprised at unexpected behavior.

However, I'm running GNOME 3.22.2 on Debian 9, which does not exhibit this behavior. Neither had I experienced such on Fedora 25. Starting a terminal, any terminal, always drops me to ${HOME}.

How exactly are you opening a terminal? Through the activities overview or other?


All times are GMT -5. The time now is 06:55 AM.