Xfce Forum

Sub domains
 

You are not logged in.

#26 2010-01-24 11:08:07

ManOfSteel
Member
Registered: 2005-10-06
Posts: 104

Re: How to keep xfce4-terminal open?

gnome_refugee wrote:

This thread's getting so long it's easy to forget previous posts! In my 2nd one I said "I can't get it to stay open. This is easy to do with the '-hold' option in xterm, so I'm hoping there's some little-known or clever command option for xfce4-terminal that does this as well."

I actually like good old xterm, and would use it as default terminal except it doesn't have tabs.

Which is why I proposed what I did (using Xterm). It seems the only alternative that really works for what you want. I'm not proposing that you ditch Terminal as default terminal emulator, I'm proposing that you use Xterm for that command only. I don't think the lack of tab support should be a big problem since you're only using Xterm for one command and not for interactive work.
Do what suits you best.

Offline

#27 2010-01-29 20:49:35

DMcCunney
Member
Registered: 2010-01-28
Posts: 21

Re: How to keep xfce4-terminal open?

gnome_refugee wrote:

There doesn't seem to be a '-hold' option for xfce4-terminal. Any other way I can keep it open with a single command?

The problem is that top runs continuously till you explicitly quit out of it.  "ps" runs and exits, and takes terminal with it, since it lacks a hold option.

Try a different approach.  Pipe the output of ps to something that doesn't terminate.

I created a tiny shell script called showps and made it executable.  It contains one line:

ps -ejH|less

I created a launcher on the Xfce desktop and named it "ps".  The command line was /home/dennis/showps.  Options were "Use startup notification" and "Run in terminal".

When the launcher is double-clicked, ps -ejH runs and pipes its output to the less pager.  Less runs in the terminal, and since it doesn't terminate till you explicitly tell it to, the terminal window stays open.

(This might work with a bash alias instead of a shell script.  I haven't tried it.)
______
Dennis

Offline

#28 2016-07-11 12:22:52

skorefish
Member
Registered: 2016-07-11
Posts: 1

Re: How to keep xfce4-terminal open?

try:

xfce4-terminal -e 'bash -c "ps -ejH|less;exec bash"'

works on xfce4/gentoo linux

Last edited by skorefish (2016-07-11 13:06:19)

Offline

#29 2016-12-17 15:22:44

witcher
Member
Registered: 2016-12-17
Posts: 2

Re: How to keep xfce4-terminal open?

I had the same problem today and this "stack-exchange" post was extremely useful for me: http://unix.stackexchange.com/a/77556

For me below command worked:

xfce4-terminal -e 'sh -ic "<my command>; exec bash"'

...which is similar to the reply from user above, but `Ctrl+C` and `Ctrl+Z` will work as expected.

To be more specific, I wanted to produce nice `startup` scripts for my dev ThinkPad with Ubuntu 16.04 + xfce. I wanted to have single script that will run all the needed things (like IDE and openvpn, etc) in the separate tabs/windows. Especially with the vpn, I wanted to have the vpn command in the last history, since from time to time I need to restart it... (((:

So I end up with this (I use zsh, that's why `print -s` instead of `history-s`):

VPN_CMD="<...>"
IDE_CMD="<...>"
xfce4-terminal -T vpn -e 'zsh -ic "print -s \"'"${VPN_CMD}"'\"; '"${VPN_CMD}"'; exec zsh"' \
         --tab -T intellij -e 'zsh -ic "print -s \"'"${IDE_CMD}"'\";'"${IDE_CMD}"';  exec zsh"'

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.014 seconds, 8 queries executed - Memory usage: 532.54 KiB (Peak: 533.38 KiB) ]