0

As I newby, I am facing a challenge with regard to opening a new xterm with the 'xterm' command. The challenge is mostly because of my lack of background knowledge how an xterm is created and not knowing all it's ins & outs.

My situation:

At my workplace, I have an application which opens up a GUI, which happens to be running an a different host. I can verify this with "echo $hostname". The GUI of the app provides a button to open a new xterm. From now on, I will refer to this terminal as custom xterm. This custom xterm is not the same in terms of some of the environment variables, links, etc. compared to a Linux login-xterm or one opened from the Redhat Linux system menu. Interestingly, the custom xterm does process my local .aliases and .bashrc file at creation time, I simply verified this by executing some of the aliases defined in .aliases, created by myself. I also noticed that where in my login-server/host I have access to /bin/python while the other host has not. These are some of the differences.

Though, this custom xterm clearly has access to all my local files, just as any other xterm. When starting up another new xterm from this custom xterm with the 'xterm' command, we get a clone of this xterm. Nothing strange here I guess.

My Question:

Is there a way, from the command line of this custom xterm, to startup a new xterm with the exact same environment settings as the original login-xterm from the login server/host?

What I already know:

I am aware of the app-defaults/Xterm configuration file, but this only configures fonts and looks as far as I know and experienced. I guess, this is not what I am looking for to achieve my goal. Neither is my answer in the .aliases or .bashrc files.

I looked at the humongous user manual of the Xterm command, but failed to find what I am looking for. Any help would be much appreciated. Thanks.

Update 1:

I guess any of your valuable directives can only have weight if I provide you with enough information of my case. The point is that there are multiple servers/host available on the workplace, these are dedicated servers for applications which can potentially consume relative large amount of memory and/or cpu power. An xterm of such a remote server is available, from which I want to start a login-behaving like terminal. And as I explained in my OP, I require the exact same shell (not xterm) environment as Barry pointed out my mistake. The easiest way to check this is echo $hostname. I believe that each server/host has it's own /bin apps, I am interested in the /bin/python app of the login-host, as there is usually no python on the other hosts/servers installed. Hope that clarifies a bit more of my quest...

Update 2:

After some more research, I am leaning toward the thought that what I want is not possible without some sophisticated server/client tools, such as ssh. I was under the impression that any xterm should be able to interact with apps provided by the KDE (Redhat) GUI. Hence, if that is possible per my thought, the remote/custom xterm should also be able to access my KDE apps and also startup a login-xterm, the same way a user would do interactively by mouse-clicking it's way through the 'All Application' menu and selecting the Xterm icon. Since pre-installed apps of any server are located in it's own /bin dir, it rules out access of the /bin dir of the login-server by default means. Hence, why starting up a login-Xterm from a remote server's Xterm is not possible without ssh or something similar.

Update 3

As user10489 confirmed my previous suspicion regarding ssh requirement, I think I need to investigate how this other process to run the special app on a remote server is actually started and if there is a way to do the same from the remote host back to my host via it's xterm. This will help me to understand what is possible or not in the IT framework of my workplace. Thanks user10489.

6
  • This is unhelpful: environment is a property of your shell, not of xterm. Look into xterm's -e option to run something other than the default bash command when you open a new xterm. You'll then need to figure out how to open a "clean" shell. Good luck! Commented Jul 29, 2022 at 19:14
  • 1
    `env -i xterm& Commented Jul 29, 2022 at 19:15
  • Hey Barry, not sure what your context is with "This is unhelpful". I already emphasized that I am new to this genre/topic. I appreciate the -e option though, maybe that will lead me to the right place.
    – LinuxNewby
    Commented Jul 29, 2022 at 19:24
  • xterm -e env -i bash & will reduce the amount of environment variables.
    – sudodus
    Commented Jul 29, 2022 at 19:49
  • Thanks sudodus and Thomas. It starts a new term without any of the environment dependencies. But parent? or host is still the same, it's not the original login server/host. echo $hostname.
    – LinuxNewby
    Commented Jul 29, 2022 at 19:56

1 Answer 1

1

In unix, when you start a new process, by default, it inherits a copy of all the environment variables from the parent process unless the parent decides to change what is passed.

xterm is not special in this way -- if you start an xterm, it gets everything. However, xterm only opens a window on the local host.

If you want to access a remote host, usually you use something like ssh, which could be run within an xterm. It's also possible to ssh to another host and open the xterm from the remote host through the ssh pipe (this usually requires the -X or -Y option). ssh copies some of the environment variables to the remote host. There are options to tell ssh to copy more of the environment variables, and you can also manually copy critical things.

If you want to run programs on the remote host, they need to either be installed on the remote host, or come from a directory shared between the remote host and the local host. This could be things installed in a shared home directory, or installed in an intentionally shared applications directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .