Tag Info

Hot answers tagged

143

Run a command without putting it in history: Simply put a space before the command. Bash will ignore commands with a prepended space: Example: Spaceecho "Some secret text" Note: This only works if the HISTCONTROL variable is set to ignorespace or ignoreboth. Disable history temporarily: Run Spaceset +o history or Spaceshopt -uo history to disable ...


17

shopt -uo history should do it best. Nuking the HISTFILE (et al) variables won't stop your Up history being logged, it just won't push it to disk. This may or may not be a positive thing for you, but given you mention it, I guess you want something better. Changing the shopt history setting stops the whole history mechanism from triggering. You can turn ...


13

You can simply delete the history of one particular terminal session by adding command history -cw after working. Do not close the terminal before giving the command.


8

To temporary disable the command history for the current session, you can temporarily unset the HISTFILE environment variable. unset HISTFILE while the session is active you can access the history as usual, but it won’t be saved to the disk. To reverse in the same session (all changes will be recorded) HISTFILE=$HOME/.bash_history


7

Another way to kill the current shell without logging to the history file is to do: kill -9 $$ This causes bash (and probably other shells too) to send the SIGKILL signal to itself, killing it on the spot and preventing it from writing anything to disk.


4

I use a method that has some similarities to the answer of terdon (and was created with some help of him - Thank you @terdon for this!), but has a slightly different approach: I create a temp file so that the child terminal can communicate with the parent terminal and tell it the PID of its corresponding bash instance. Then I let the parent terminal read ...


3

If you walk back through history (e.g. with Up or Ctrl+P) and change a line without executing it, only the modified version of the line will be saved. You can modify it in any way you like that would prevent it from being modified; good choices would include using Ctrl+U to totally blank the line or using Esc# to put a # comment character at the beginning. ...


3

In their infinite wisdom, the GNOME devs decided to remove that option. Unfortunately, their wisdom did not extend to also updating their man page which still lists it. So, it looks like gnome-terminal will always be run int the background and the parent shell session will be returned to immediately. To get around this, you have a few options: Just use ...


3

The issue is your program don't have access to write to the temporary folder. ls works because it reads the current folder without "saving" anything. find on the other hand "caches" data to the temp folder. If he can't it crash! Check your permissions on the /tmp folder. ls -la /tmp You should get something like this. bookofzeus@askubuntu:~$ ls -la /tmp ...


2

Sorry, gnome-terminal doesn't support this. The actual emulation is handled by the vte widget. In its source code, src/caps.c contains the table where matching/parsing the incoming escape sequences begins. \e] is called OSC here, and OSC "52..." is not defined here.


2

Actually I figured it out ! When I press AltGr + Space, a non-breaking space is inserted, which looks exactly like a space... but isn't one. On a french keyboard, the pipe character is inserted using AltGr + 6. What happens is sometimes the AltGr is still down when I press the Space, which is why this "bad" space character is inserted. This problem has a ...


2

TL;DR: create a function that saves output of the pwd command to a file, and then use that file to launch gnome-terminal with whatever was in that file as argument to gnome-terminal --working-directory=. Step 1: getting your last directory: Bellow is a function savewd(for save working directory), which you should place at the end of your ...


2

It's not possible with current gnome-terminal. If you're not afraid of recompiling it from source, well, there's a patch available at https://bugzilla.gnome.org/show_bug.cgi?id=709109.


2

Yes, the typical shortcut for copy and paste on the terminal (not only on gnome and not even only on gnu/linux is ctr + shift + v. Ctrl + c is Interrupt/Kill whatever you are running (SIGINT). It would not be prudent to change that. These shortcuts are older than Ctrl + c, ctrl + v. A more elaborate and better answer is here: ...


2

Answered here I quote: The user title code was removed1 from gnome-terminal 3.14. There's only one way to set the title, using an escape sequence - e.g. with bash: PROMPT_COMMAND='echo -ne "\033]0;YOUR TITLE GOES HERE\007"' 1: see gnome bug 724110 and gnome bug 740188.


2

Setting $PROMPT_COMMAND as shown above has zero effect here. No surprise, because Bash runs inside the terminal and parent processes (here: gnome-terminal) can't read a child's environment on a unix-like OS. Using something more simple, like PROMPT_COMMAND='echo bla' Executes echo bla, nothing else happens. Edit: one has to wrap this in escape ...


2

The Ubuntu maintainers of the gnome-terminal package noticed this issue and created a wrapper script (in Ubuntu package gnome-terminal-3.14.2-0ubuntu3) to re-enable the --disable-factory option; however, the wrapper script doesn't work! From the changelog ...


2

You could also make .bash_history read-only. I would empty the file first and then do: chattr +i .bash_history


2

I can't believe they removed such a user friendly feature like this one. I'm switching to ROXTerm (http://roxterm.sourceforge.net), which does the job nicely. It's packaged in Ubuntu: sudo apt-get install roxterm Then, let the dinosaur continue its own way ;-)


1

Now I've investigated this for the better part of a day and finally found a way to set this title. It's done via escape sequences which start with \e]0; and end with a BEL character ( = \007 = \a). Unlike I stated above, communications from the shell back to the terminal application is possible, very limited, through such escape sequences (there are a few ...


1

First of all I'd like to confirm what you've already figured out, namely that directly under gnome-terminal (that is, outside of tmux or screen) you should set TERM=xterm-256color, whereas inside tmux or screen it should be set to TERM=screen-256color. Apparently your .zshrc segment properly sets it for the shell that's run directly by gnome-terminal. I'm ...


1

Create a script: nano ~/<your_script_folder>/open_selection Include the following code: #!/bin/bash selected_text=$(xclip -o) if [[ "$selected_text" == ~* ]]; then file_name=$(readlink -f ${selected_text/\~/$HOME}) else file_name="$selected_text" fi notify-send "Open selection" "$file_name" xdg-open "$file_name" *You can replace xdg-open ...


1

What you could do as an alternative is to parse output of grep as an argument to your text editor of choice. For instance COMMAND | grep -i filename | xargs nano In this case nano is just a placeholder. You could use whatever text editor you want there. What you might want to do is to add a nohup in front of text editor name, so that you can continue using ...


1

I think what you're looking for is under the "colors" tab. Mid-way down is a checkbox and a slide bar adjust it. Slide it all the way to the right to get full transparency. Below is a picture of it.


1

That's simple =) gsettings set org.gnome.desktop.wm.preferences audible-bell false gsettings set org.gnome.desktop.wm.preferences visual-bell true and gsettings set org.gnome.desktop.wm.preferences visual-bell-type frame-flash Options for visual-bell-type: fullscreen-flash - causes a fullscreen white-black flash frame-flash - causes the titlebar of ...


1

In recent versions of gnome-terminal, you can use the following escape sequences to change the cursor: \e[ q: reset to whatever's defined in the profile settings \e[1 q: blinking block \e[2 q: steady block \e[3 q: blinking underline \e[4 q: steady underline \e[5 q: blinking I-beam \e[6 q: steady I-beam You can print these by e.g. echo -ne '\e[5 q'. This ...


1

You can change this behavior by editing the terminal profile. Right-click in the terminal window and choose Profiles >> Profile Preferences Or from the menu: Edit >> Profile Preferences Navigate to the the compatibility tab and find 'Backspace key generates' Select 'ASCII DEL' If this did not help, refer to this and this.


1

In the gnome-terminal.desktop file, you need the Exec to contain the command exactly as you would run it via a shell. In this case, the gnome-terminal executable e parameter needs a quoted string to execute: Exec=gnome-terminal -e 'tmux -2'


1

sudo apt-get install gnome-terminal But this should not happen. You proably use non-standard repositories and some dependecies are broken.


1

I installed Gramp and tried it here, and this should really work: Exec=/bin/bash -c "LANGUAGE=en_GB gramps" LANGUAGE= takes precedence over LANG= Note Make sure you run the application from the local .desktop file: After editing the local one, make sure you log out / in before running it again.



Only top voted, non community-wiki answers of a minimum length are eligible