gnome-terminal

How to reference Main once only in this ubuntu terminal command: “javac Main.java && java Main”?

允我心安 提交于 2019-12-01 09:59:57
I am reviewing a number of different java programs and am trying to work out how I can update the reference to the program name once only instead of twice. Is there a way to use a variable in a single terminal command? :S The command I'm trying to improve is of this form: javac Main.java && java Main I only want to change the reference to Main once instead of typing it twice each time. You can do it with one line like this: PC=com/mycompany/Main && CN=$(echo $PC | tr / .) && javac $PC.java && java $CN This will work even if you have a package name as it will automatically replace / with . to

How to change the background color of gnome-terminal?

拈花ヽ惹草 提交于 2019-11-30 04:57:52
How to change the background color? I selected Profile > Background > solid color , but where can I select the color? Since it seems to be Terminal you're talking about, did you disable "Use colors from system theme" under Colors? Once you do that, you can pick a background color, still under the Colors tab. The Background tab looks like it only allows selecting an image (or transparency), which tripped me up as well. Paul There are two well-supported ways to change the background color of an xterm (remember xterm != Terminal). A. Set the color when you create the xterm: E.g., % xterm -bg

Open gnome terminal programmatically and execute commands after bashrc was executed

送分小仙女□ 提交于 2019-11-30 04:07:33
I try to build a little script to start my development environment. For that task I try to open a gnome terminal with several tabs where automatically the rails server and autotest is started. But gnome-terminal --tab -e "rails server" --tab --tab does not work ("error creating the child process"). Also gnome-terminal --tab -e "bash -c \"rails server\"" --tab --tab` does not work. Any suggestions how to solve that problem? Zardoz Here is a nice trick we worked out at Superuser Add a eval "$BASH_POST_RC" to the end of your .bashrc Set the BASH_POST_RC environment variable for each tab to that

emacs - [control shift up] doesn't work

你说的曾经没有我的故事 提交于 2019-11-29 12:03:02
I tried to define hotkey as following (global-set-key [(control shift up)] 'other-window) but it doesn't work (no error, just doesn't work), neither does (global-set-key [(control shift down)] 'other-window) But (global-set-key [(control shift right)] 'other-window) and (global-set-key [(control shift left)] 'other-window) work! But because the last two key combinations are used by emacs (as default), I don't wanna change them for other functions. So how could I make control-shift-up and control-shift-down work? I have googled "(control shift up)", it seems that control-shift-up is used by

how to open a gnome terminal to execute a command with gnome-terminal, constantly?

Deadly 提交于 2019-11-28 23:44:06
I have a sh file which includes those lines: gnome-terminal\ --tab\ --title="ElasticSearch"\ --working-directory="/home/username/program/bin"\ -e "bash -c './somecommand'"\ when I run it, a gnome terminal will open and run a command for me. The problem is, when I press ctrl+c to stop the running command, the terminal closed. Is there a way to stop the running command and keep the terminal alive? Thanks in advance. Your command works fine but the gnome-terminal closes after the somecommand terminates, the reason being gnome-terminal not running the bash as it's default shell. To get the bash

emacs - [control shift up] doesn't work

ぐ巨炮叔叔 提交于 2019-11-28 05:59:38
问题 I tried to define hotkey as following (global-set-key [(control shift up)] 'other-window) but it doesn't work (no error, just doesn't work), neither does (global-set-key [(control shift down)] 'other-window) But (global-set-key [(control shift right)] 'other-window) and (global-set-key [(control shift left)] 'other-window) work! But because the last two key combinations are used by emacs (as default), I don't wanna change them for other functions. So how could I make control-shift-up and

In linux, how can I test whether the output of a program is going to a live terminal or to a file?

陌路散爱 提交于 2019-11-28 03:26:53
问题 When you use git it seems to magically know whether standard out is going through a pipe or into a file vs when it is being displayed to the console. For example, if you have colors enabled and you do git status it will colorize the output for different categories of files being listed. However, if you do git status | less or git status > status.txt it removes the linux color formatting and you only see plain, uncolored text. How does git detect whether the output of its commands are going to

How to do multiple arguments with Python Popen?

百般思念 提交于 2019-11-27 13:13:33
问题 I am trying to make a PyGtk Gui, that has a button. When the user presses this button, gnome-terminal prompts the user to write their password. Then it will clone this Git repository for gedit JQuery snippets. And then, it copies the js.xml file to /usr/share/gedit/plugins/snippets/js.xml In the end, it forcefully removes the Git repository. The command: gnome-terminal -x sudo git clone git://github.com/pererinha/gedit-snippet-jquery.git && sudo cp -f gedit-snippet-jquery/js.xml /usr/share

Prevent Gnome Terminal From Exiting After Execution [duplicate]

本秂侑毒 提交于 2019-11-27 05:15:37
This question already has an answer here: Avoid gnome-terminal close after script execution? 7 answers How do you prevent gnome-terminal from exiting after its given command has exited? I'm calling gnome-terminal from a cronjob, in order to create a terminal accessible to the user. The terminal is initially given a specific program to run. e.g. gnome-terminal --tab -e "/usr/bin/myprog" This works fine, except that when "myprog" exits, so does the gnome-terminal. How do I keep it running, but just drop back to a terminal prompt? Try this: gnome-terminal --tab -e "/bin/bash -c '/usr/bin/myprog;

Open a terminal via gnome-terminal then execute command, error : “failed to execute child process”" [closed]

余生颓废 提交于 2019-11-27 03:36:00
问题 Via a bash command, I want open a terminal and, from the new terminal, execute a simple bash command. I tried: gnome-terminal -- "/bin/bash -c ls" But I got this error: I don't understand the error and I cannot find an example anywhere for help. 回答1: The quotes are telling the terminal to run an executable in /bin called bash -c ls (with the spaces as part of its name!). There exists no such executable. Take them out: gnome-terminal -- /bin/bash -c ls ...or, to actually make something stay