date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,483,602,912,000
It would be awesome to modify spark to print narrow characters in for example Gnome Terminal. Is this at all possible with Bash / Python?
No. While VT100-compatible terminals do have support for double-width lines (using the DECDWL control sequence), they don't have support for narrow lines or characters.
Narrow characters
1,514,674,496,000
I am having a little problem with my ubuntu16.04 terminal. I wanted to have access to a data-base through the use of the : echo source /Infos/bd/config11 >> .bashrc echo source /Infos/bd/config11 >> .bash_profile However I unfortunately don't have acces to this data-base since it's not on my computer. Every time I open a terminal I see: bash: /Infos/bd/config11: No such file or directory What can I do to stop seeing this on my terminal? Thank you.
To avoid seeing this, you should edit your startup scripts so they no longer attempt to source the missing file: sed -i 'sXsource /Infos/bd/config11X#&X' ~/.bashrc ~/.bash_profile This will comment out the line in both files.
wrong echo command
1,514,674,496,000
I'm using Gnome Terminal to connect via SSH to my server. My account on the remote server (which is Ubuntu) uses bash. My bashrc contains a line that sets the shell prompt to include my current git branch if applicable: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h: \[\033[32m\]\w\[\033[00m\]\$(parse_git_branch)\$ " When I am inside a git repo, my terminal stops wrapping properly. Long commands that should wrap onto the second line instead wrap to the beginning of the line they started on and start printing right on top of my prompt. I don't experience wrapping issues except when my working directory is inside a git repo (i.e., when parse_git_branch's output is not empty). I know that non-printable characters should be enclosed in \[ and \] so that the shell (or terminal?) knows not to count them towards the length of the prompt. I'm fairly confident that the "export" line has correctly done that... but my regex-fu is not strong enough to understand what that sed command is doing, and I think it isn't inserting the non-printable characters properly. This question is extremely similar (and even uses the same parse_git_branch function, which we got from here), but the other question involved having an emoji in the prompt, which is not the case for me. Does anyone know what is wrong with my prompt?
This turned out to be because I had enabled the ui color=always option in git, not directly because of my shell prompt or the parse_git_branch function. The "git branch" command was displaying with color, but the original author of the parse_git_branch function did not account for that and chopped the string up in such a way that the color codes didn't get closed properly. Adding the --no-color flag to the "git branch" command inside of the parse_git_branch function was enough to fix the issue, but I had actually grown accustomed to the colors -- so here is how to replicate the gold background: parse_git_branch() { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h: \[\033[32m\]\w\[\033[00m\]\[\033[7m\033[33m\]\$(parse_git_branch)\[\033[00m\]$ "
Terminal doesn't wrap properly [closed]
1,514,674,496,000
I was running Fedora 34 until now. Fedora 38 came out and I moved to that. I'm using MATE with Gnome Terminal. The font is set to Monospace 13 in both systems. Yet there's a difference in the font. What I don't like in Fedora 38. How could I have the same font like I had in Fedora 34? The change can be seen especially on "r"
"Monospace" is not a real font; it's merely an alias to some or other font, which traditionally used to be DejaVu Sans Mono on Linux for about a decade – with the distinct flattened @ shape as in your "original" screenshot. (DejaVu fonts weren't really great fonts though, merely decent, but for a long time there weren't any better FOSS fonts available, especially for a distro such as Fedora that was strongly concerned with licensing. However, now that more free fonts exist, it is not surprising that Fedora has changed the default.) If you run fc-match Monospace you will see the current mapping. How could I have the same font like I had in Fedora 34? First, install the fonts. Fedora no longer includes DejaVu by default, so install dejavu-sans-fonts via DNF (or download them from GitHub into your ~/.local/share/fonts/). Once installed, just change the terminal font through GNOME Terminal's "Profiles > Default". Changing font aliases system-wide Within GNOME, the org.gnome.desktop.interface monospace-font-name GSetting might be the one that controls the alias system-wide (although of course you can just change it for the terminal alone; it's fine to use one monospace font for terminals and another for normal text). GNOME Tweaks > Fonts > Monospace Text regedit: dconf-editor > /org/gnome/desktop/interface/monospace-font-name gsettings set org.gnome.desktop.interface monospace-font-name "Something 11" Outside of GNOME, such aliases are defined via Fontconfig (e.g. /etc/fonts/conf.d). For example, create a ~/.config/fontconfig/fonts.conf that contains: <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <alias> <family>Monospace</family> <prefer> <family>DejaVu Something Or Other</family> </prefer> </alias> </fontconfig> as documented in man fonts.conf.
Fedora's Gnome Terminal's Monospace font changed?
1,514,674,496,000
I am trying to install clamav in kali for removal of viruses in PC and USB.and I did: root@kali:~# apt-get install clamav Reading package lists... Done Building dependency tree Reading state information... Done Package clamav is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'clamav' has no installation candidate Any Help??
Check your repos: http://docs.kali.org/general-use/kali-linux-sources-list-repositories Update the local cache using: apt-get update (as Svetlin Tonchev said.) try again with: apt-get install clamav Optional: Search for it using: apt-cache search clamav
E: Package 'clamav' has no installation candidate?
1,514,674,496,000
I often need to grep for a particular expression in a large text file. For some reason the private vendor decide to use CR (carriage return, \0D) to separate argument on a particular line of the text file. However the CR character gets interpreted by the terminal, making my grep or cat command pretty much useless. So how would one display the content on the following file on a terminal (eg. xterm-256color). $ hexdump /tmp/bla 0000000 3031 3030 3020 0d20 3335 310d 3132 3830 0000010 300d 302e 3031 3030 0d30 0a33 000001c So far I tried without much luck: $ TERM=dumb cat /tmp/bla 3.010000
GNU cat has a few options to aid printing files containing such special characters: -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB So cat -v /tmp/bla should do it in your case. Or perhaps even -et, which also prints tabs and line ends in a special way.
Do not interpret Carriage Return (`\0D`) in my terminal
1,514,674,496,000
What should I enter inside gnome-terminal to change its current geometry to 80x24? The same action as GUI's Settings - Advanced - 80x24.
xdotool getactivewindow windowsize --usehints 80 24 --usehints Use window sizing hints (when available) to set width and height. This is useful on terminals for setting the size based on row/column of text rather than pixels.
gnome-terminal: change the window geometry from cli
1,514,674,496,000
I've recently installed Linux Mint 18.1 and I'm using Terminal all the time. My Terminal is GNOME version 3.18.3. There are various menus in the GNOME Terminal. In Windows you typically access something like "Edit" by going Alt-E. This doesn't work for Terminal. Is there any way of of accessing these menus without being forced to use the mouse?
In GNOME Terminal, you can access the menu using F10. Press that to open the File menu, then use the arrow keys to navigate inside that menu (↑ and ↓) or to open other menus (← and →). You can enable menu shortcuts (AltF for the File menu etc.) by checking the “Enable mnemonics” option in the preferences: You can also disable the F10 shortcut here.
Use Terminal menus without using mouse?
1,514,674,496,000
I am using Arch linux. However after the recent gnome update, I am not able to copy or paste anything into or from gnome terminal to gui applications like editors or browsers. However I am able to copy and paste within the the terminal like coping and pasting a previous command or output. I am also able to copy paste within GUI applications, for example between an editor and a browser. How ever I am not able to copy paste from the browser to the terminal or from the editor to the terminal and viceversa. I am sure this is not a keyboard shortcuts issue as Ctrl+ C, Ctrl+ V,Ctrl+ Shift +C, Ctrl+ Shift + V as expected when used within the terminal or among the GUI applications. I have tried installing clipit, but there is no difference. I am pretty sure I didnt have the issue before.
Copy/paste between Wayland windows and XWayland windows does not work yet (it has not been implemented). I can't manage to find any official source on this, but here are a couple of links to posts saying exactly this: http://www.phoronix.com/forums/forum/software/desktop-linux/49641-gtk-3-18-plans-for-full-wayland-support-a-scenegraph?p=631866#post631866 https://www.reddit.com/r/linux/comments/35hz3t/wayland_session_on_gnome_316_part_3_of_wayland/cr4ti4n Update This feature has been implemented in mutter 3.17.2 (see the release notes).
Cannot copy-paste from or to the gnome-terminal
1,514,674,496,000
My gnome-terminal on a ubuntu 10.10 machine is not working the way it should work. No autocomplete is working. ctrl + l won't clear the screen, bash prompt is simply a $ and nothing else. I got this machine passed on from someone else. I just created a new user for myself and hoped that I would get a fresh start. I checked and there is no /etc/profile or /etc/bashrc. There was a folder named .profile.d that I renamed to something else. Stil the problem persists. There are no configuration files inside my home directory either (.bashrc, .bash_profile, .bash_aliases)
make sure that you are indeed running bash and not another csh for example by executing the following: ps -p $$ This will tell you what shell you are running. If this returns something different than bash you can try your shortcuts after running the following: bash You can also change the users shell by running: chsh -s /bin/bash `whoami`
Gnome Terminal won't autocomplete
1,514,674,496,000
I installed konsole and uninstalled gnome-terminal by doing: sudo apt install -y konsole sudo apt-get purge --auto-remove gnome-terminal And then tried: sudo update-alternatives --config x-terminal-emulator To set konsole as the default emulator, wich returns: There is only one alternative in link group x-terminal-emulator (providing /usr/bin/x-terminal-emulator): /usr/bin/konsole Nothing to configure. But neither the default Ctrl + Alt + t shortcut works nor do right click open terminal. How do I solve this issue?
After using the command: sudo update-alternatives --config x-terminal-emulator And selecting Konsole from the terminals menu. I still had to go to Linux Mint's "Preferred Applications" menu and set Konsole as the default emulator. That was the only thing that worked for me.
Replace gnome-terminal with konsole in Linux Mint
1,514,674,496,000
I am writing a bash script where I pretend to open a new terminal window (in this case a gnome-terminal), execute some commands and change the title of the terminal window. In order to change the title of the terminal window I am using the function set-title as proposed in this answer. The approach works perfectly when I open manually a new terminal and type inside the terminal set-title MY_TITLE. But in this case, from within a bash script it is not working even if I source the .bashrc file. #!/bin/bash gnome-terminal -- /bin/bash -c "echo Hello from terminal 1; set-title Terminal 1; exec /bin/bash"; gnome-terminal -- /bin/bash -c "source ~/.bashrc; echo Hello from terminal 2; set-title Terminal 2; exec /bin/bash"; The two new opened terminals show the same error: /bin/bash: set-title: command not found It is obvious that the bash interpreter does not find the function set-title, but I do not know how to force the loading of the .bashrc file when the gnome-terminal is opened.
I will answer my own question but before explaining the two solutions I have found, I will explain why what I was trying to do did not worked. Why my initial approach was wrong If you have custom functions in your ~/.bashrc file, like in my case the one for setting the title of the terminal window, those functions will not be available in a terminal window that is opened from a bash script that executes commands in an automated way (as in the example of my question). Thanks user414777 for the hint. You were absolute right. My ~/.bashrc file contains the following code at the beginning: # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac By printing the option flags $- the result is hB (as expected is not an interactive shell), so obviously the set-title function that I have at the end of the ~/.bashrc, will never be added to the shell. Solution 1 (Recommended): Using xfce4-terminal As schrodigerscatcuriosity suggested, this is the easiest solution for the problem. You might not like to install another terminal tool; if (like in my case) you are using Gnome and you use by default gnome-terminal, but the good side is that you can use the xfce4-terminal for the bash scripts and the gnome-terminal for your "human" interaction, so besides the titles you also have an extra level of categorization (in case you have many terminal windows opened). The xfce4-terminal works a bit different than the gnome-terminal from within a bash script, but nothing you can not really figure out. In any case you can find below the solution with xfce4-terminal: #!/bin/bash xfce4-terminal --title "Terminal 1" -e "bash -c 'echo Hello from terminal 1; exec /bin/bash'" & xfce4-terminal --title "Terminal 2" -e "bash -c 'echo Hello from terminal 2; exec /bin/bash'" & Solution 2: Using xdotool Another solution that I found to the problem is using xdotool. xdotool is a command line tool that can simulate/automate human interaction in the X11 window system. This solution is overengineering the initial problem since it creates other issues such as the synchronization between the bash script and the X windows system, therefore it is necessary to introduce sleep commands in the bash script to give time to the X window manager to process the events. This synchronization issues make this solution not reliable since it does not works in 100% of the cases and the sleeping times need to be adapted to the speed of the window system. Despite I do not recommend to go for this solution for the exposed problem in the question, I decided to introduce the solution in the answer for the shake completeness. Someone else might find it useful to apply this approach for some other purpose: #!/bin/bash function set-title(){ sleep 0.2 # local WINDOW_ID=`xdotool getactivewindow` # local P_ID=`xdotool getactivewindow getwindowpid` # echo "the window id is: $WINDOW_ID with PID: $P_ID" xdotool type "set-title $@" xdotool key KP_Enter sleep 0.2 } gnome-terminal -- /bin/bash -c "echo Hello from terminal 1;echo $-; exec /bin/bash"; # xdotool search --onlyvisible --class 'gnome-terminal' set-title "Terminal 1" gnome-terminal -- /bin/bash -c "echo Hello from terminal 2; exec /bin/bash"; # xdotool search --onlyvisible --class 'gnome-terminal' set-title "Terminal 2" In this case, the function set-title included in the ~/.bashrc file will work because after the commands have been executed in the gnome-terminal, the last instruction is /bin/bash. It loads the shell again and the next commands are forwarded to the terminal using xdotool, which creates the same events that a human would generate with the input devices (mouse, keyboard, etc ...).
How to rename terminal window from a bash script?
1,514,674,496,000
Problem I coincidentally was trying to print a string to STDOUT in gnome-terminal that contains a lot of square brackets and noticed it took a lot of IO time (~4sec for ~100KB). To confirm that there is something specific about that string, I printed another string of the length, and the time is very different. Specifically: $ time cat file1 # ... snip ... real 0m3.968s user 0m0.004s sys 0m0.001s $ time cat file2 # ... snip ... real 0m0.052s user 0m0.006s sys 0m0.001s $ ls -l file* -rw-rw-r-- 1 sinan sinan 115441 Dec 19 16:38 file1 -rw-rw-r-- 1 sinan sinan 115441 Dec 19 16:38 file2 file1: https://pastebin.pl/view/raw/060c3b2d file2: https://pastebin.pl/view/raw/ffbdd6a4 I cannot tell what is the cause of the slowdown, I suspect something in gnome-terminal parses square brackets and gives them a special meaning. Does anyone have any idea? Version Information gnome-terminal --version: GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD bash --version: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Egmont reported the bug on the vte bug tracker (vte is a terminal emulator library used by gnome-terminal, anjuta, deepin-terminal, gtkterm, lilyterm, lxterminal, mate-terminal, remmina, sakura, tilda, vinagre, xfce4-terminal, …). It turned out to be a bug in the underlying fribidi library, which is unfixed as of October 2021. Workaround: disable bidirectional support Egmont also suggests a workaround which is to disable bidirectional support. Obviously, that workaround only helps if you don't care about bidi support. For Gnome-terminal, you can do it via a hidden setting which has to be applied to each profile. The following command does this permanently for your account: for p in $(dconf list /org/gnome/terminal/legacy/profiles:/); do dconf write /org/gnome/terminal/legacy/profiles:/${p%/}/enable-bidi false; done For any vte-using terminal, you can disable bidi support temporarily with printf '\e[8l' but this only lasts until the terminal is reset. If you put this in your shell prompt, it'll help in command line applications, but not in full-screen applications. In bash: PS1='\[\e[8l\]'$PS1 In zsh: PS1='%{\e[8l%}'$PS1 A more general terminal-independent way to effectively disable bidi support is to change the terminal's reset sequence to include \e[8l. The terminal name (value of $TERM) in vte is xterm-256color. See How to stop cursor from blinking for explanations. This command will only affect new terminals, not ones that are already open. TERM=xterm-256color infocmp -1 | sed '/^.rs[12]=/ s/,$/\\E[8l,/' | tic -
Printing a sequence of square brackets in `gnome-terminal` is very slow
1,514,674,496,000
A few days ago, my ubuntu console started printing '^A' whenever I hit 'CTRL+A', instead of moving the cursor to the start of the line as it did before. The same problem happens for 'CTRL+E', while the 'CTRL+Arrow' shortcuts behave as they should. However, if I log in to a remote machine via ssh, everything works fine. Unfortunately, I do not remember anything in particular which could have triggered this behaviour (I have not changed shortcuts, nor modified my '.bashrc' file, nor updated the system). some useful information: I am not using nor screen nor tmux or other terminal multiplexers; joe@Zen:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 19.10 Release: 19.10 Codename: eoan joe@Zen:~$ echo $TERM xterm-256color joe@Zen:~$ ps -f -p$PPID UID PID PPID C STIME TTY TIME CMD joe 11539 1575 0 12:27 ? 00:00:04 /usr/libexec/gnome-terminal-server joe@Zen:~$ echo $SHELL /bin/bash joe@Zen:~$ cat /proc/version Linux version 5.3.0-62-generic (buildd@lcy01-amd64-018) (gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)) #56-Ubuntu SMP Tue Jun 23 11:20:52 UTC 2020 Thank you in advance if you give me some ideas about what could I try.
I would suggest that you have inadvertently changed your line editing scheme from the default "emacs" to "vi". You can reset this back with set -o emacs Or change it back to vi mode with set -o vi
Bash: CTRL+A prints ^A to stdout
1,514,674,496,000
I am using UBUNTU 16 LTS and terminal GNOME v3.18... How to back to standard configuration? I try to use mouse scroll and pgUp/pgDwn but nothing works.
Perhaps a program switched to the alternate screen without restoring. This will undo that (a command): tput rmcup
terminal GNOME lost scroll, how to back normal?
1,514,674,496,000
I need to start an application automatically within a terminal like xterm or gnome-terminal in one command line. Is that possible?
Umm, yes. I'm leaving out the "without user intervention" bit here, because I don't know what that means in this context. With xterm: xterm -e somecommand The terminal will exit as soon as somecommand exits. If that's not wanted, you may explicitly start an interactive shell as well: xterm -e sh -c 'somecommand; bash' See the xterm manual (man xterm). I'm sure that gnome-terminal can do the same (see its manual).
How to start an application within a terminal in one command [closed]
1,514,674,496,000
I am on a SUSE Linux Enterprise Desktop 11 (SP4) machine, with Gnome 2.28.2 running. I set a keyboard shortcut to launch "gnome-terminal" command. And I also added a Launcher shortcut to Panel to do the same. The launcher shortcut on the panel works correctly. It brings up the terminal and sources my profile and changes directory to my home directory. But the keyboard shortcut brings up the terminal, does NOT source my profile and changes directory to / How can I make the keyboard shortcut open the terminal while also sourcing my profile and cd-ing into my home directory?
Answer 1 - Modify gnome shortcut to open correct directory It is possible to modify shortcuts in Gnome using the gconf-editor, which you may or may not need to install by running the following command. yum install gconf-editor After starting the program you will go to apps > metacity > keybinding_commands as seen in the image below. Next you will select an unused or modify an existing shortcuts "value' to the following: gnome-terminal --working-directory=/path/to/dir This will not source your .profile, but it will ensure the shortcut opens in the appropriate directory. Answer 2 - Change default working directory in Gnome It is possible to modify default working directory in Gnome using the gconftool-2, which you may or may not need to install by running the following command. yum install gconftool-2 Then run the following as your user to fix the current session gconftool-2 --set --type=bool /apps/nautilus-open-terminal/desktop_opens_home_dir true Then as root, run the following command to make this take effect on login gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=bool /apps/nautilus-open-terminal/desktop_opens_home_dir true Sources ANSWER-1 nixtutor.com - Adding Custom Shortcuts to Gnome ANSWER-2 redhat.com - How do I change the "default working" directory of terminal applications
Keyboard shortcut to open gnome-terminal in GNOME 2.28.2
1,514,674,496,000
Some red text output with git or autojump, are hard to see. I want it become bold. Maybe we can tweak some ansi color code? In the screen-shot below, all bold red text comes from my script. the "j" is autojump's command.
I found the solution about git one. modify in ~/.gitconfig. [color "status"] changed = blue normal bold added = green bold deleted = red bold untracked = magenta bold To autojump output, I can make a alias or script to deal with. addition: After search, I found detail introduce here, hope can help others. https://gist.github.com/rab/4067067 [color "diff"] new = blue bold old = red bold frag = magenta bold meta = green reverse
Can I tweak all red text to bold in gnome-terminal
1,514,674,496,000
When I resize my terminal, weird artifacts start to happen. The past lines start to get mixed. Here's a gallery with what I mean. What is the problem here? How do I fix it? What part of the stack is causing the problem? Is it the Terminal? The shell? I'm using GNOME-Terminal with zsh on Ubuntu 16.10. No, manual reset doens't solve the problem.
gnome-terminal (more precisely the VTE widget), unlike most other emulators, rewraps its contents upon resize. Generally this is a useful feature getting great feedback from users; however, with shell prompts, it indeed often causes weird behavior. With the date being printed in the right margin, when you resize the window to become narrower, the prompt is wrapped into two lines by gnome-terminal. Afterwards, zsh is notified of the window size change and it repaints its prompt without knowing that gnome-terminal has wrapped it into two lines. You can try to have a much simpler prompt (without stuff being aligned to the right), or disable rewrapping in gnome-terminal's profile preferences.
Resizing the terminal causes it to mix previous lines and duplicate pieces of text
1,514,674,496,000
I just installed ubuntu GNOME 16.04. So far, so good. When I run "GNOME terminal", I can do the all the things. But when asked to press "Enter", and I press the button labeled "Enter" on my kepboard near the keypad, it just does an error squirt-beep. If I press the button above right shift (labeled <-|), it works. How can I get the Keypad's "Enter" button to work in gnome terminal? Thanks! Update this fixed itself (rather I have no idea what fixed it). It was a new install: zsh, oh-my-zsh, custom profiles, software, 20 reboots, etc.
The two Enter keys are different. The one above the right-shift key sends a carriage-return character (which the terminal driver translates to line-feed as newline), while the other may send an escape sequence when the keypad application mode is enabled. Your instructions meant the former (unless the application uses curses, for example). If you are trying to use a curses (or ncurses) application, you still are not guaranteed that you can use the two interchangeably. Some developers are confused by the difference, and ignore KEY_ENTER when they notice that the Enter key on the keyboard sends just a carriage return. Along with that, some terminal descriptions have been written (no surprise) which equate kent (the terminfo name for KEY_ENTER) with carriage return or line feed. A lot of those are for obscure terminals which you probably do not use (and they represent a minority of the terminal descriptions). For xterm, kent is assigned to the escape sequence. It's been there a while (predating gnome-terminal): # 9.11.3 (Thu Nov 9 12:14:40 EST 1995): # * Added kspd=\E[P, kcbt=\E[Z, to linux entry, changed kbs back to ^H. # * Added kent=\EOM to xterm entry.
Gnome Terminal - keypad enter just beeps
1,514,674,496,000
I face the problem with $_ usage, which $_ special parameter in terminal, And its call the last argument of the previous command. It was not work with cp and mv command in gnome-terminal.It happen to me during folder creation and mv or cp file with $_ like below mkdir test cp file.c $_ instead of copying file to destination , it create a file in current directory named _filedir. Same happen with mv command mkdir test mv file.c $_ instead of moving file to destination, It moving in the name _filedir. To find the problem i use echo $ mkdir test $ echo $_ _filedir Why is $_ not working with cp, mv commands?
$_ - Gives the last argument to the previous command. At the shell startup, it gives the absolute filename of the shell script being executed. When you execute mkdir test mv file.c $_ Check if your mv, cp is an alias In bash to acces the last arg to the previous command in History use !:$ ,like: > mkdir test > mv file.c !:$ mv file.c test
$_ not working with copy and move commands
1,514,674,496,000
I was trying to build the AWN from source, and I installed a bunch of glib/gio dev packages required by libdesktop-agnostic (also built from source) that affect gsettings. At some point during this, I rebooted and found that I couldn't launch any gnome-terminal. (Other gnome apps work normally.) When I use the nemo-extension terminal (that's a gnome-terminal embedded into nemo) I get the following: (gnome-terminal:11314): GLib-GIO-CRITICAL **: g_settings_get: the format string may not contain '&' (key 'monospace-font-name' from schema 'org.gnome.desktop.interface'). This call will probably stop working with a future version of glib. ** ERROR:terminal-app.c:1449:terminal_app_init: assertion failed: (app->default_profile_id != NULL) Aborted (core dumped) I checked 'monospace-font-name' in the schema 'org.gnome.desktop.interface' using dconf-editor, here's what gsettings get says: ~ $ gsettings get org.gnome.desktop.interface 'monospace-font-name' 'Monospace 10' ~ $ No ampersands there. It seems like having some libglib/gio's installed at once also causes the following related, similar gnome error-quarks that break gnome-notifications: [gnome-control-center] notifications: fix invalid format string | mail.gnome.org gnome-terminal: GLib-GIO-CRITICAL messages from gnome-terminal-server | bugs.debian.org Which are great, but I'm kinda a novice at most of linux's technical-ness and I don't know really how (or, importantly, WHERE) to apply said patches. Before you ask, I don't know which packages are causing this (there are waaaay too many in the libglib namespace) and I can't easily single them out one at a time without breaking lots of things. Yes, all my repositories are official and yes, everything is up-to-date and in order as far as I can tell. Linux Mint 17.2 Rafaela (ubuntu 14.04/trusty) running Cinnamon2.6.1.3 amd64 on a Toshiba Satellite p755 (intel, 6gb ram) (there's nothing of interest in other log files, including .xsession-errors)
I had this problem. Exactly the same issues, to the point - I am running Linux Mint 17.2 Rafaela (ubuntu 14.04/trusty) running Cinnamon2.6.1.3 amd64; except it's an Asus machine. I am with you, I want my gnome-terminal back. This is what I did to fix it: sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade That was it. The problem was that libglib and the other packages were too new to work with gnome-terminal. So a full distro upgrade fixed all the dependencies. This probably happened after a system update and a reboot. Until the system is rebooted, it will still work fine. But only after that it throws the errors.
gnome-terminal broken due to gsettings+libglib
1,514,674,496,000
Working with Linux Mint Cinnamon and Gnome Terminal, how do I use the term/colors files available from here: http://dotshare.it/category/terms/colors/
All the files there are X resources files for Rxvt (most of them specifically for Urxvt, the Unicode-aware version of Rxvt). They are not generic terminal emulator configuration files, they are configuration file for that specific terminal emulator. They can't be used by Gnome-terminal. If you want to try them out, install the rxvt-unicode package. Download one of the Xdefaults file and run XENVIRONMENT=/path/to/Xdefaults urxvt If you want to make one the default: Many of these files are badly written and will work with the explicit XENVIRONMENT, but not the .Xresources method. If there are lines that contain comments starting with #, remove them or replace the # with !, which is the comment start character in X resource files. Also, if there are any lines beginning with * or ?, add Rxvt before it. For example http://dotshare.it/dots/1042/ should start with ! rxvt-unicode (urxvt) v9.15 - released: 2012-01-21 Rxvt*color0: #0C0C0C … Whitespace doesn't matter but capitalization does. Copy the corrected file to ~/.Xresources. This file is loaded when you log in. To apply the settings now, run xrdb -merge ~/.Xresources.
How do I use a terms/colors file
1,514,674,496,000
I am using gnome-terminal in LXDE. When I have several gnome-terminal windows open, after some time the cursor in the inactive window starts to blink as well, as if the inactive window was actually active. This only happens with gnome-terminal. Other terminal emulators such as LXTerminal work fine. see video of the problem here: http://youtu.be/nRBehoJ1L7Y I am aware of this bug. But this should have been fixed in my version of xserver-xorg-core 1.12.4-6. I am using Debian Wheezy and gnome-terminal 3.4.1.1-2 I am wondering if this could be caused because I am using gnome-terminal on LXDE. Could there be some gnome component missing? I have no way of testing if the same problem exists on Gnome.
You can switch to terminator. It is an awesome full featured terminal emulator. It is a bit ugly (in my opinion) when you install, but can easily customize it and even made it look like gnome-terminal.
gnome-terminal: cursor blinks in inactive window
1,514,674,496,000
In the interactive shell oh PHP Delete key is not working and produce ~ instead. Anyone know how to get this key to work? I am using Ubuntu 13.04 if this does matter.
Have you tried running rlwrap -a around the PHP interactive shell? rlwrap fixes many of these types of problems for me in various REPLs.
Delete key doesn't work properly in PHP interactive shell
1,514,674,496,000
When I use su root and then use gnome-terminal I get warning ** (gnome-terminal:2677): WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported and new terminal window does not opens.But when I use su - and then use gnome-terminal new window opens without any warning . Why is it so ?
The environment setup when providing - is much more complete. From the man page: The optional argument - may be used to provide an environment similar to what the user would expect had the user logged in directly. In particular SESSION_MANAGER is missing if you do su root. You can output the environments by using env | sort > /var/tmp/XXX.env with XXX being different for the - and root invocation, and then compare the output using diff. In my setup (Ubuntu 12.04) this results in about twice as many lines in the su - case (53 vs. 27).
New Terminal not works when we use su root
1,514,674,496,000
How do I change the default gnome-terminal location on screen. I checked out the preferences but they only have option to change default size. I also checked out .gconf/apps/gnome-terminal/ but didnt find any thing out. All in all my gnome-terminal should normally be gnome-terminal --geometry=80x24+200+200 I dont want to do it through launcher because I will always have to start the terminal from launcher to get that location.
If it's only the sublime plugin that's bothering you, you just have to edit the plugin preferences and add the geometry parameters: Preferences > Package settings > Terminal > Settings - Default { "terminal": "", "parameters": ["--geometry", "80x24+200+200"] } Another way, if you also want Alt-F2 to open a terminal at that location: gnome-shell Alt+F2 runs commands in your $PATH so you could create a new executable (e.g.gterm) somewhere in your $PATH (e.g. /usr/local/bin). Edit /usr/local/bin/gterm like this: #!/bin/sh exec gnome-terminal --geometry 80x24+200+200 make it executable: chmod +x /usr/local/bin/gterm Now you can run gterm via Alt+F2, it will open a terminal @80x24+200+200. You can also point sublime to gterm (note there's no need for parameters anymore since gterm is already a custom size/position terminal): Preferences > Package settings > Terminal > Settings - Default { "terminal": "gterm", "parameters": [] }
change terminal window default location
1,514,674,496,000
Is there a way to open a new terminal tab in GNOME-Terminal when working on a remote machine that is connected via ssh?
tmux (or screen, the older alternative) are great for this. tmux lets you do both horizontal and vertical splits. You'll probably want to customize tmux, e.g. most people like cmd-a over cmd-b as the 'prefix' key. I use the following ~/.tmuf.conf file settings to make it work better for me: # mdd tmux settings bind r source-file ~/.tmux.conf \; display "Reloaded!" # Reload with ctrl-r set -g prefix C-a # prefix from ctrl-b to ctrl-a unbind C-b # allow ctrl-b for other things set -sg escape-time 1 # quicker responses bind C-a send-prefix # Pass on ctrl-a for other apps set -g base-index 1 # Numbering of windows setw -g pane-base-index 1 # Numbering of Panes # bind | split-window -h # Split panes horizontal bind \ split-window -h # Split panes horizontal bind - split-window -v # Split panes vertically bind h select-pane -L # Switch to Pane Left bind j select-pane -D # Switch to Pane Down bind k select-pane -U # Switch to Pane Up bind l select-pane -R # Switch to Pane Right bind -r C-h select-window -t :- # Quick Pane Selection bind -r C-l select-window -t :+ # Quick Pane Selection bind -r H resize-pane -L 5 # Switch to Pane Left bind -r J resize-pane -D 5 # Switch to Pane Down bind -r K resize-pane -U 5 # Switch to Pane Up bind -r L resize-pane -R 5 # Switch to Pane Right setw -g mode-mouse off # Mouse Off set -g mouse-select-pane off # Mouse Off set -g mouse-resize-pane off # Mouse Off set -g mouse-select-window off # Mouse Off #set -g default-terminal "screen-256color" setw -g monitor-activity on # Activity Alerts set -g visual-activity on set -g status-fg white # Status line Colors set -g status-bg black setw -g window-status-fg cyan # Window list color setw -g window-status-bg default setw -g window-status-attr dim setw -g window-status-current-fg white # Active Window Color setw -g window-status-current-bg red setw -g window-status-current-attr bright set -g pane-border-fg green # Pane colors set -g pane-border-bg black set -g pane-active-border-fg white set -g pane-active-border-bg yellow set -g message-fg white # Command/Message Line. set -g message-bg black set -g message-attr bright set -g status-left-length 40 # Status Line, left side set -g status-left "#[fg=white]Session: #S #[fg=yellow]#I #[fg=cyan]#P" set -g status-utf8 on # Status Line, right side set -g status-right "-------" set -g status-interval 60 # frequency of status line updates set -g status-justify centre # center window list setw -g mode-keys vi # vi keys to move unbind v # Open panes in same directory as tmux-panes script unbind n bind v send-keys " ~/tmux-panes -h" C-m bind n send-keys " ~/tmux-panes -v" C-m unbind Up # Maximizing and Minimizing... bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp unbind Down bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" # Make keys for copy mode be like vi unbind [ bind Escape copy-mode unbind p bind p paste-buffer bind -t vi-copy 'v' begin-selection bind -t vi-copy 'y' copy-selection I also set the following aliases (in my ~/.bash_aliases file) to let me switch between scrolling and being able to copy text: alias tof='tmux set -g mode-mouse off' alias ton='tmux set -g mode-mouse on'
GNOME-Terminal: Create new terminal tab on remote machine
1,514,674,496,000
I want to view mplayer's normal terminal output, and also write it to a log. That works fine when I run mplayer from the commandline, eg: mplayer "$HOME/gdr01.wav" 2>&1 |tee $HOME/junk.log However, I want to launch mplayer in it's own gnome-terminal window. Neither of the following commands write to the log, althought the terminal display works. (gnome-terminal -e "mplayer $HOME/gdr01.wav 2>&1 |tee $HOME/junk.log" &) gnome-terminal -e "mplayer $HOME/gdr01.wav 2>&1 |tee $HOME/junk.log" & What is at play here, and what is the trick to get it to work? EDIT: The problem is that I get the terminal's mesages being written to the log (eg. an ibus warning). However, although mplayer generates thousands of lines, none are written to the log.
What's going on is that gnome-terminal's command line parsing is funky. You're running mplayer with /home/ferer/gdr01.wav, 2>&1, |tee and /home/ferer/junk.log as arguments. If you wait for the end of the audio file, you'll see error messages about these nonexistent files for a microsecond before the terminal closes. Either figure out gnome-terminal's intricate rule. Or, what I recommend: yse the -x option instead of -e and invoke a shell explicitly. gnome-terminal -x sh -c 'mplayer "$HOME/gdr01.wav" 2>&1 |tee $HOME/junk.log'
No output to log from tee when starting mplayer as an arg to gnome-terminal
1,514,674,496,000
Is there a log feature for gnome-terminal like the "session log" in Putty? I want to log whatever I have typed in the gnome-terminal. I don't want to use pterm under Linux, I just want a gnome-terminal. See an example log here.
You can use script (the command, not 'a script'!) to log shell sessions. Here's some info at about.com.
Putty-like "Session Log" for gnome-terminal?
1,514,674,496,000
I am using the Awesome window manager with Arch, kernel 6.5.5. When I start gnome-terminal for the first time and every other time where I don't already have an instance of gnome-terminal running, it takes several seconds (~20 seconds). I have tried using the gnome window manager as it was suggested in this similar issue and it does fix the issue, but I don't want to use another window manager. I am very interested in how to investigate and solve this problem, but I am unsure of what to look for. journalctl --user -r : Oct 07 07:59:25 arch-pc xdg-desktop-por[6096]: Failed to create settings proxy: Error calling StartServiceByName for org.freedesktop.impl.portal.desktop.gnome: Timeout was reached Oct 07 07:59:00 arch-pc systemd[1673]: Started VTE child process 6212 launched by gnome-terminal-server process 6091. Oct 07 07:58:35 arch-pc systemd[1673]: xdg-desktop-portal-gnome.service: Job xdg-desktop-portal-gnome.service/start failed with result 'dependency'. Oct 07 07:58:35 arch-pc systemd[1673]: Dependency failed for Portal service (GNOME implementation). Oct 07 07:58:35 arch-pc systemd[1673]: Current graphical user session is inactive. Oct 07 07:58:35 arch-pc dbus-daemon[1699]: [session uid=1000 pid=1699] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.gnome' unit='xdg-desktop-portal-gnome.service> Oct 07 07:58:35 arch-pc systemd[1673]: Starting Portal service... Oct 07 07:58:35 arch-pc dbus-daemon[1699]: [session uid=1000 pid=1699] Activating via systemd: service name='org.freedesktop.portal.Desktop' unit='xdg-desktop-portal.service' requested by ':> Oct 07 07:58:35 arch-pc systemd[1673]: Started GNOME Terminal Server. Oct 07 07:58:35 arch-pc dbus-daemon[1699]: [session uid=1000 pid=1699] Successfully activated service 'org.gnome.Terminal' Oct 07 07:58:35 arch-pc systemd[1673]: Starting GNOME Terminal Server... Oct 07 07:58:35 arch-pc dbus-daemon[1699]: [session uid=1000 pid=1699] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.41' (ui> Oct 07 07:54:43 arch-pc sudo[5217]: pam_unix(sudo:session): session closed for user root Stating that xdg-desktop-portal-gnome.service is having trouble starting. A recent update fixed this issue on my pc. the packages below where all updated. xdg-desktop-portal-1.18.0-2 xdg-desktop-portal-gnome-44.2-2 xdg-desktop-portal-gtk-1.14.1-3 Just to be clear, I did not manage to find xdg-desktop-portal-gnome.service with systemctl on my pc.
I'm not sure what's exactly wrong, but you can probably check the journal for log of the gnome-terminal-server.service user service to see if it actually reported anything: journalctl --user-unit gnome-terminal-server.service The systemd service is started via dbus through its "companion" dbus service file. There will be only one server instance at a time and the server will exit whenever all the windows/tabs have been closed. So what you are experiencing indicates that it occurs every time during the starting up of the server. It could be the "channel" (dbus) that has problem. It could also be just a problem of the server process itself. You may also want to just check journalctl -e and journalctl --user -e after the problem occured in case it is something else that is stalling the startup. For the record, it's not expected to be slow even if you are not in a GNOME session and/or not using GDM to start your window manager. In my experience it still starts faster than the python-based terminator anyway in normal circumstances.
Gnome-terminal slow start for first instance on arch
1,514,674,496,000
I want a command that opens a terminal and executes a function that is defined in my aliases.zsh. The function is defined like so: my-function() { wget some stuff do some other stuff } I tried gnome-terminal -- my-function, but the new terminal reports that it Failed to execute child process “my-function” (No such file or directory). Something similar happens if I do gnome-terminal -- /bin/zsh -c 'my-function; sleep 1; exec zsh': in the new terminal, zsh reports zsh:1: command not found: my-function. Any help greatly appreciated.
~/.zshrc is the customisation file for interactive invocations of zsh. zsh -c 'some code' is an inline script. Like for scripts starting with a #! /bin/zsh - shebang, thankfully, the ~/.zshrc is not sourced on startup. If it were, and you had aliases / functions that change the behaviour of standard commands (it's not uncommon to have alias 'ls=ls --color -F' 'grep=grep --color;...), that could break zsh scripts. If you want a script to load ~/.zshrc or ~/.zprofile or /etc/zsh/zshrc, you need to request it explicitly. But best would be to put those functions in some ~/.zsh/some-library.zsh and source that instead in the scripts that need it as well as your ~/.zshrc, or use the autoload framework. gnome-terminal -- zsh -c '. ~/.zsh/some-library.zsh; myfunction' If you wanted an interactive zsh to be started in gnome-terminal but that first runs your function before issuing the first prompt, you could add a: eval -- $ZSH_INIT_COMMAND unset ZSH_INIT_COMMAND To the end of your ~/.zshrc, and run gnome-terminal as: gnome-terminal -- env ZSH_INIT_COMMAND='myfunction; echo and whatever else' zsh Or if you wanted to start it as if it had been written at the prompt, so you could handle it the same way, change it to: if (( $+ZLE_INIT )); then seed-zle() { BUFFER=$ZLE_INIT unset ZLE_INIT zle -D zle-line-init unset -f seed-zle zle accept-line } zle -N zle-line-init seed-zle fi And start gnome-terminal as: gnome-terminal -- env ZLE_INIT='myfunction; echo and whatever else' zsh
Open gnome terminal and execute user-defined zsh command
1,621,581,088,000
I got as my first desktop environment gnome. As i go to DWM and wanna call the terminal by Alt+Shift+Enter, the terminal opens in gnome environment, but not in dwm.
in the source code of dwm there's a variable called "termcmd" assuming the terminal under gnome is called "gnome-terminal" you'll have to replace "st" with "gnome-terminal"
Terminal problem DWM
1,621,581,088,000
I have a live running mate-terminal whose scrollback buffer already contains a lot of text with color/bolding, but (unfortunately) no screen management/capture program (like script/screen/tmux) was started on the terminal. Is it possible to copy the existing scrollback buffer contents to a file, preserving all escape sequences? There is an answer to this problem for xterm by Thomas Dickey, but even in that solution the color escape sequences are not getting saved to the file specified by the printerCommand resource. but I am looking for a solution for mate-terminal. Edit note: It seems unlikely that a solution for this problem exists for the mate-terminal; see the comments in Thomas Dickey's answer below. Just to be clear, pre-starting a terminal screen management/capture program (like script or GNU screen or tmux) is not an option, because here we want to copy terminal output already produced before starting any such program.
You may have overlooked the printAttributes resource: printAttributes (class PrintAttributes) Specifies whether to print graphic attributes along with the text. A real DEC VTxxx terminal will print the underline, highlighting codes but your printer may not handle these. o "0" disables the attributes. o "1" prints the normal set of attributes (bold, underline, inverse and blink) as VT100-style control sequences. o "2" prints ANSI color attributes as well. The default is "1". The default resource value makes it compatible with DEC terminals; color is something that you can configure.
Copy terminal scrollback buffer preserving ANSI escape sequences, but without pre-starting script/screen
1,621,581,088,000
I was updating my linux mint 18.3 to linux mint 19. The error I get is Cannot set LC_ALL to default locale: No such file or directory. Then I Restarted my System, after that I can't open the terminal. I used Ctrl+Alt+F3 to run command line and fixing the LC_ALL error by using the command sudo dpkg-reconfigure locales and sudo aptitude install locales and it worked. Then I tried to install terminal by using the command apt install gnome-terminal but it gives the error Setting up install-info (6.5.0.dfsg.1-2) ... /usr/sbin/update-info-dir: 5: /etc/environment: Syntax error: Unterminated quoted string dpkg: error processing package install-info (--configure): subprocess installed post-installation script returned error exit status 2 Errors were encountered while processing: install-info E: Sub-process /usr/bin/dpkg returned an error code (1) I tried to resolve that using this https://askubuntu.com/a/920076/842467 but nothing happened.
The thing about error messages is that they tell you what's wrong. Your error message clearly says that there is an unterminated quoted string in /etc/environment. Once you read that, you should investigate that file to see if it looks odd with regards to double quotes. In a comment, you mention that your /etc/environment file has the contents: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" :/usr/java/jre1.8.0_171/bin" JAVA_HOME="/usr/java/jre1.8.0_171" (or something similar, formatting is difficult in comments). Here, you can clearly see that the :/usr/java/jre1.8.0_171/bin" bit at the end of the first line looks out of place (and a space too many). You, or a script, have edited the file and messed up the PATH. That line now contains an unbalanced double quote. My guess is that the PATH should be set as: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jre1.8.0_171/bin"
Syntax error: Unterminated quoted string
1,621,581,088,000
Gnome allows the default Terminal Profile to be changed for new Terminals created with Ctrl+Alt+T. But what if I want to: Create a new terminal with a specific profile from the command line gnome-terminal --profile=<profile_name> --working-directory=<full_path> echo $SHLVL produces 2. Is there a way to do this where the SHLVL is 1?
You can set SHLVL manually for that command to compensate for the erroneous +1: SHLVL=0 gnome-terminal Opens a new window. Then echo $SHLVL 1
Launch Gnome Terminal with Shell Level 1?
1,621,581,088,000
When I login (using ssh) to other host and open a new tab (pressing CTRL + Shift + T). It sets current working directory to a particular directory in my home independent from current working directory on remote host. So what can be the reason for this behavior? And how can I change it? I am using RedHat.
When you press Ctrl+Shift+T, Gnome-terminal looks at the current directory of the process that's running in this tab, and switches to that directory to run the process in the new tab. Observe that if you type bash in a Gnome-terminal tab that's already running a shell and is in /directory1, and you run cd /directory2 in that instance of bash, then press Ctrl+Shift+T launches a new tab with a shell in /directory1. Gnome-terminal only looks at its child process's current directory, not at its descendants. (That's the only reasonable way, really: how would it decide which descendant to pick?) When you run ssh to open a shell on another machine, Gnome-terminal does what it always do: when you open a new tab, that tab starts in the directory of the shell from which you ran the ssh command. Gnome-terminal has no way to know about the current directory on another machine. To do that, it would need some very tight integration with SSH and with the remote shell. I'm not saying it's impossible — Emacs's Tramp parses the prompt from the remote shell to figure out the remote directory — but it has a cost in complexity, reliability and flexibility. Gnome-terminal gives you a terminal and lets you do what you want in it; Tramp takes control of the SSH connection and doesn't cope with arbitrary behavior of the remote shell. You cannot change this without doing some nontrivial development work. You could use Emacs as your terminal emulator (but of course Emacs is far from being a drop-in replacement for Gnome-terminal, you'd need to pick up different habits). If all you need to do on the remote machine is manipulate files and not run programs, you can mount the files over SSHFS, and then you'd only be running a local shell so you'd get the current directory tracking that you want. But by far the simplest way to create a new tab in the same remote directory is to create a new tab, run the same ssh command, and copy-paste the remote path.
New terminal working directory
1,621,581,088,000
When I connect to a debian 8 server I can't change gnome-terminal tab's title, see for yourself: $ ssh deb6-server $ echo -en '\e]0;test\a' # title changes $ echo $TERM xterm-256color $ cat /etc/issue Debian GNU/Linux 6.0 \n \l $ exit $ ssh deb8-server # here the title changes to USER@HOST: CWD $ echo -en '\e]0;test\a' # title doesn't change $ echo $PROMPT_COMMAND $ echo -en '\e[0;34mtest\e[0m\n' test # written in blue $ echo $TERM xterm-256color $ cat /etc/issue Debian GNU/Linux jessie/sid \n \l And I don't really know where else to look. Any ideas?
If the ESC ] 0 escape sequence works to change your terminal's title when you use it locally, it also works across SSH. SSH doesn't change the traffic between the application and the terminal. If you run applications in a screen multiplexer such as screen or tmux, these do interpret escape sequences by themselves and send others to the terminal. That's independent of SSH, except inasmuch as you might be more inclined to use screen on a remote machine than locally. The shell on the remote machine may well be configured to set the remote title whenever it starts to execute a command or whenever it displays a new prompt. This is usually done by printing the title-changing escape sequence as part of the prompt, so check the content of the PS1 variable: printf '%s\n' "$PS1" | cat -v If the remote shell is bash, also check the PROMPT_COMMAND and the DEBUG trap: echo "$PROMPT_COMMAND" trap -p DEBUG If the remote shell is zsh, check PS1, RPS1 (rare), and the precmd and preexec functions. print -rl $PS1 $RPS1 $functions[precmd] $functions[preexec]
Can't change gnome-terminal tab's title from within ssh session on remote debian 8 machine
1,621,581,088,000
I want to open my terminal with some commands executed in it on bootup. So I wrote a script with following line in it: gnome-terminal --tab -t "MyPC" -e "sh -c 'firefox &;exec bash'" --tab -t "MYPC2" -e "sh -c 'ls;exec bash'" In this firefox & is not executing, however if I write only firefox it executes. So only the second tab is opening not the first one I know it's some spacing issue. If I write just ls that also executes. What is the correct syntax? Why is it not taking spacing??
Putting a ; after a & does not work. & is already a command separator, specifying, that the command should be run in the background, so ; is not required. Try removing the ; and report back.
gnome--terminal -e option not executing?
1,621,581,088,000
I have a very strange problem on my Ubuntu 14.04 machine. I can't use some letters like r and i in gnome-terminal. Note: when my CapsLock is on I can type R and I in terminal. The problem on my terminal is for just these two letters when in lowercase. For example I can't use the rm command. UPDATE #1 I used: $ sudo su Now as the root user I can type r and i. What is the problem? How can I fix it?
I found the problem. I decided to activate tab completion in Python's interactive mode. So I added the following lines to /home/user/.inputrc: import rlcompleter, readline readline.parse_and_bind('tab: complete') So when I rebooted my machine the keys r and i from import and readline effected on my keyboard.
Some letters on gnome-terminal can't be typed by specific user [closed]
1,621,581,088,000
This is embarrassing, but I don't seem to be able to set the command-prompt or the shell title. I'm using Gnome3 on centos 7. PROMPT I've added the following to ~/.bashrc: export PS1="\w \$ " The prompt stays the same: echo $PS1 [\u@\h \W]\$ I've also tried updating the ~/.bashrc without the export: PS1="\w \$ " Same result. It is almost like something is overriding it. TITLE As for the title I've tried the following: echo -ne "\033]0;hi\007" It doesn't take effect.
Here is what I had to do in my .bashrc export PS1="\\n[\\!. \\t - \\w]\\n>" set_title() { PROMPT_COMMAND='echo -ne "\033]0;'$1'\007"' } I found this answer useful.
How to set the prompt and tab-title on Gnome-Shell (Gnome 3, centos 7)
1,621,581,088,000
In Fedora 16, when accessing the Windows partitions via the Fedora GUI, it would get mounted on /media/. They were visible as /media/Data etc and I was able to navigate into those partitions via the terminal. But now I see the partitions mounted on the GUI, but they're not visible in /media/. Could you help with navigating to the partitions via the terminal? Or to put it in another way: Where do the Windows partitions get mounted to, when mounted via the GUI?
Fedora uses as standard the gnome desktop. Gnome uses a virtual file system called gvfs, to represent network shares. They are not mounted to a specific mount point. If you want to browse those mounts via terminal you have to use the gvfs tools (gvfs-*). If your partitions are mounted the old way then just type mount to find out where they are mounted.
Fedora 20: How to navigate to Windows partitions via commandline?
1,621,581,088,000
I recently started using a bash script to setup terminal workspaces for myself, and everything worked fine for the first couple of days. I run the script, and four or five or seven terminals pop up, all in precisely the right places on the screen, all cd'ed into the proper directories, ready for use. This morning I installed conky, and the next time I tried to run my script, the oddest thing hapened. Now it will only open the first window. When I close that window, the second one opens. When I close that one, the third, and so on until the end of the script. So now my script is useless except as a pasteboard for me to copy and paste into the terminal from. Here is my script: #!/bin/bash if [ $1 = "deploy" ]; then cd ~/ gnome-terminal --geometry=185x41+0+0 --window-with-profile=Colquhoun cd ~/Utilities/Ad\ Tag\ Generators gnome-terminal --geometry=85x15+1312+0 --window-with-profile=Generator cd ~/Utilities gnome-terminal --geometry=85x28+1312+280 --window-with-profile=Deployer cd ~/Staging gnome-terminal --geometry=85x20+1312+730 --window-with-profile=Monitor fi if [ $1 = "servers" ]; then cd ~/ gnome-terminal --geometry=89x20+0+0 --window-with-profile=Colquhoun gnome-terminal --geometry=89x20+640+0 --window-with-profile=Colquhoun gnome-terminal --geometry=89x65+1280+0 --window-with-profile=Colquhoun gnome-terminal --geometry=89x20+0+360 --window-with-profile=Colquhoun gnome-terminal --geometry=89x20+640+360 --window-with-profile=Colquhoun gnome-terminal --geometry=89x20+0+700 --window-with-profile=Colquhoun gnome-terminal --geometry=89x20+640+700 --window-with-profile=Colquhoun fi if [ $1 = "logchecks" ]; then cd ~/ gnome-terminal --geometry=89x65+0+0 --window-with-profile=Colquhoun gnome-terminal --geometry=89x65+640+0 --window-with-profile=Colquhoun gnome-terminal --geometry=89x65+1280+0 --window-with-profile=Colquhoun fi Does anyone know why this might be happening? And why it wasn't happening previously but is now?
Append an & to the end of each gnome-terminal command to make sure each terminal starts in the background. If you haven't killed them sooner, the terminals will exit when conky exits and kills all child processes.
Script that spawns terminal windows suddenly waiting for each window to close before opening the next one
1,621,581,088,000
Trying to create a command that rename terminal title and run a application, I'm adding the commands inside .bash_aliases file. The rename command I'm using is: PS1='\[\e]0;test\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' If I use it alone and after run the application it works as expected. But if I use the command like this: alias rpcs3="PS1='\[\e]0;test\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' && ./rpcs3/rpcs3-v0.0.25-14385-b639f3c8_linux64.AppImage" Using this latter command, the terminal title only change after the application is closed as shown in the example below: Before closing the app After closing the app What should I do?
The alias is not working because the shell prompt waits until your program finishes. A solution to this is by first calling to your command ./rpcs3/rpcs3-v0.0.25-14385-b639f3c8_linux64.AppImage and run it in background: alias rpcs3="./rpcs3/rpcs3-v0.0.25-14385-b639f3c8_linux64.AppImage & PS1='\[\e]0;test\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '" And given that your command will run in background when you press Enter you will get back to shell prompt (the title will be set before, so this has no problem anymore). If you want to get back to foreground the process ./rpcs3/rpcs3-v0.0.25-14385-b639f3c8_linux64.AppImage you should use the command: fg. For getting which jobs are running in background in your current shell you can use the command/shell builtin jobs. For example: $> jobs -l #Output [1] Running gnome-calculator & [2]- Running gnome-calculator & [3]+ Running nautilus & If I want to get back to foreground the nautilus process I can use: fg 3 #You can also specify the `command name` instead of the ID. Probably in your case you only will have one process in background (./rpcs3/rpcs3-v0.0.25-14385-b639f3c8_linux64.AppImage). So you can simply use fg 1.
Rename terminal title && run application using alias
1,564,841,499,000
I used instruction to customize my terminal profile. Renamed terminal titles. I saved terminals with: gnome-terminal --save-config=/tmp/term-cfg I restored terminals with: gnome-terminal --load-config=/tmp/term-cfg All my titles was replaced with full directory path. So instruction did not help me with title saving. Can i do something to save\restore tab-titles?
It seems i can not find correspond command to solve the problem. So I created recommended script. This script has some problems but better than nothing. Before use script i need install xdotool with command. apt-get install xdotool to restore saved terminal i use: gnome-terminal --load-config='my path to script' But anyway i hope someone knows better solution... waiting for one. Update the answer First solution works without additional tools and scripts for some cases: title should not contain some service symbols like /
Load terminal configuration with my titles
1,564,841,499,000
I started using Sublime Text 3 to compile my FreeFem scripts (interpretator PDEs package solver) under Ubuntu 14.04. To invoke the interpretator I customized the build system as follows "shell_cmd": " gnome-terminal -x sh -c \"FreeFem++ $file ; exec sh\"" Every time I run compilation I want to create a separate terminal process that launches FreeFem++. But when I press Ctrl+C it kills the terminal. Instead of this I want to terminate process but leave the terminal window open.
Ctrl+C kills the shell as well as the FreeFem subprocess, because the SIGINT signal is sent to the whole foreground process group. Since the shell is not interactive, the subprocess runs in the same process group. See Why is SIGINT not propagated to child process when sent to its parent process? and What is the purpose of abstractions, session, session leader and process groups? for some background on process groups. You can cause the shell not to die when it receives SIGINT by setting a trap for it. (Don't ignore the signal: that would also cause it to be ignored by the subprocess.) "shell_cmd": " gnome-terminal -x sh -c \"trap echo INT; FreeFem++ $file ; exec bash\""
Ctrl+C process termination without Terminal killing
1,564,841,499,000
I have hit a few CTRL- in command line and I see the text in the terminal getting smaller with every invocation. What is going on here and is there a way to redo ie magnify the text to bring it back to the original size via a command? Edit: As per Christopher's suggestion in the comment I can get back to my original font size by hitting CTRL+ but I would still like to understand what is going on behind the scenes here.
It's a somewhat standard keyboard shortcut (it works in Konsole, too). It's simply bound to reduce font size (and simmetrically, Ctrl+ to increase font size). You can easily disable/modify by going to the shortcuts preferences: Edit ▸ Preferences ▸ Shortcuts.
Why does hitting "Ctrl minus" in the command line shrink the font size?
1,564,841,499,000
I use Linux terminal in Ubuntu. When I write seq 100 1 | less & to run it it in the background, it just stops. I used other ways to run it on background too, like using bg [jobnr] but it just stops. I find the job number, and write bg 1 (when it's 1), but then I check the process and it's not running. The same happens with man pi too or other "man pages". But pi 10000000 can run on background, and when it's finished it just prints the pi-number on terminal. It was an assignment to see if less can be run on background, and why it can't be run on background. After search online I didn't find much information about why. Why does some processes can't be run in the background but others can do run despite both printing on terminal?
less cannot run in the background because it's trying to interact with the controlling terminal, which cause it to be forcefully stopped. Only a foreground process can read from the terminal or change the terminal settings. When a background process tries to change the terminal settings, it gets a SIGTTOU signal. When it tries to read from the terminal, it gets a SIGTTIN signal. Both signals cause it to stop. If a process goes on and ignores those signals, the operations which caused them may fail, so this is not a way out of this (e.g. a read from the terminal will fail with an EIO error). Notes: less is peculiar by the fact that in order to be able to be used as command | less, it opens the controlling terminal directly via /dev/tty instead of assuming that the controlling terminal is its stdin or stderr, as other interactive programs like most editors or shells do. You can configure your terminal with stty tostop so that background programs which try to write to the controlling terminal will be stopped too, but that's not the default anywhere, and not very practical.
Why can't some processes run in the background in Linux terminal while others can, despite all being able to print to the terminal?
1,564,841,499,000
I want to be able to launch a terminal emulator (preferably gnome-terminal) with interactive zsh running inside using a custom prompt string. I don't want to modify my default prompt string in .zshrc because I use that most often and it is just occasionally I want to launch a terminal with a custom zsh prompt string (more specifically, I want the time to show up in the right hand side prompt). If I already have a terminal window open, I can solve this by running: export RPS1=%T zsh But I can't figure out the syntax for making this work together with launching a new terminal instance. This is what I have tried with the error message below each command: gnome-terminal -- export RPS1=%T zsh # Error: Failed to execute child process “export” (No such file or directory) gnome-terminal -- sh -c export RPS1=%T zsh # Prints all the options, like with `set` # and then exits with "The child process # exited normally with status 0". gnome-terminal -- sh -c "export RPS1=%T zsh" # The child process exited normally with status 0. gnome-terminal -- sh -c "export RPS1=%T; zsh" # This start the terminal with zsh, but the RSP1 is not changed I considered reading a custom rc file, like in this answer, but there does not seem to be a way of doing this in zsh without using source, which was giving me similar problems as above.
In zshrc, allow for overriding RPS1 by setting it as: # If rps1 is not set, use a default value RPS1=${rps1-"Your usual RPROMPT"} Now you can launch a command with a different RPS1 by setting rps1 in its environment, for example: rps1=%T gnome-terminal The parameter expansion form ${param-word} allows RPS1 to be set to null: rps1= gnome-terminal Parameters used by the shell (such as RPS1) needn't be exported. They are used to set up the shell, so should be set once in the rc file. If a program (e.g. gnome-terminal) is launched with rps1 in its environment, any subsequent programs launched from it will see rps1 in their environment. To avoid this, either of the following could be added to zshrc: unset rps1 (after using it to set RPS1) or typeset +x rps1. BTW, the following will export two shell variables: export RPS1=%T zsh The above is export with two arguments, resulting in RPS1=%T & zsh='' being created in the environment To set RPS1 in the current shell, simply do: RPS1=%T
Launch new terminal instance with zsh using custom prompt string
1,564,841,499,000
When I try to use write to talk to users logged into an X session results vary depending on which terminal they are using. Gnome terminal can pick up writes, but neither lxterminal nor terminator can. The reason is that lxterminal and terminator don't have associated pts devices: With lxterminal(s) running: $ who tshaw tty7 2013-01-27 21:34 With Gnome terminal running: $ who tshaw tty7 2013-01-27 21:34 tshaw pts/1 2013-01-27 22:25 (:0) (the tty7 entry in the above is the X session) Is there a way to configure other terminals to take pts devices or would that have to be done in source code?
Original question All of the mentioned programs have a pts. The problem is not that your specified terminals don't have a pts device but that the information isn't recorded. Why doesn't lxterminal or other terminals show up in who who retrieves it information from a utmp file, typically /var/run/utmp and is written to by programs themselves. In order to write an utmp entry programs have to have access to the file which normal, standard applications like lxterm or urxvt don't have. Allow access to /var/run/utmp for applications Typically /var/run/utmp is not write-able for the normal user, i.e. programs can't create new entries as a malicious user could just overwrite the file or write fake entries. On my system /var/run/utmp has following permissions: $ ls -l /var/run/utmp -rw-rw-r-- 1 root utmp 3072 Jan 28 08:26 /var/run/utmp that means in order to write to the file you have to have at least to be in the group. The best solution to give permissions to programs for updating /var/run/utmp is changing the permissions of the program so it can update the file. You can do this by setting the group of the executable to utmp and set the setgid flag which means it will set the group id from the file permissions, i.e.: chgrp utmp /usr/bin/urxvt chmod g+s /usr/bin/urxvt
Why do only some terminals get a pts
1,564,841,499,000
For an application, I need to open a new terminal window and later execute some commands in that. I tried the command gnome-terminal And it works properly, it open a new terminal, but when i want to send commands i cannot, it says that failed parsing arguments, so I'm not sure about how should i do it gnome-terminal --ls # Failed to parse arguments: Unknown option --ls
This requires a two step process. you need to start gnome-terminal running a program that waits for commands to be "sent in" you need to speak to said program to make it execute the things you want it to execute. The right syntax to start gnome-terminal with a command to execute is gnome-terminal -- command not gnome-terminal --command as you did. Having sorted out how to do 1., we need to find a program that does serves as a daemon that will listen to commands being sent in. tmux is such a server. You can run gnome-terminal -- tmux -L 'a unique name for a socket' to start your gnome-terminal with an empty shell inside. You can then use tmux' CONTROL MODE to send commands to that tmux server, e.g. to attach to the session currently displayed in the gnome-terminal, then make a new frame in that, running your command of choice in that frame. See man tmux for more detail. Honestly, though: gnome-terminal is an interactive terminal emulator. You just seem to want to display some output in a graphical manner; you don't seem to expect gnome-terminal to get input from the user. The right thing to do in that case is simply not use gnome-terminal, but use whatever you're planning to use to send commands to display a window with a constant-width font text field, and print whatever output you want there.
gnome-terminal how to send commands
1,564,841,499,000
What is the meaning of this code: gnome-terminal --tab -e "sh -c 'ch/home/Desktop'"\ could you tell me the meaning of each part of this code, one by one?
I'm afraid that code doesn't mean much, most likely. The breakdown is: gnome-terminal: this is the default terminal emulator of the Gnome desktop environment. This command will open a terminal, everything that comes after it is options and arguments that modify what gnome-terminal will do. These are: --tab : this will open a new tab in your currently open terminal. -e: this tells gnome-terminal to run a command when it launches. In your case, the command is sh -c 'ch/home/Desktop' which means "use the shell sh to run the shell script found at ch/home/Desktop. Now, that path is almost certainly wrong, since it expects to find a local directory named ch which has a subdirectory named home which in turn contains a subdirectory named Desktop. While it is possible that you have these directories on your system, it seems unlikely and you probably want /home/<YOUR USERNAME>/Desktop. Next, this is almost certainly a directory and not a shell script (which is a file). So you can't actually run it with sh. I am guessing you wanted to do something very different, perhaps pass the path to a script you have saved on your desktiop. If so, assuming your user name is skinner and the script is at /home/skinner/Desktop/my_script.sh, you would do: gnome-terminal --tab -e "sh -c '/home/skinner/Desktop/my_script.sh'" Finally, the trailing \ at the end is most likely a typo, but it will block execution if you include it since having \ at the end of the line "escapes" the end of the line character (newline, \n) which tells the system the command continues on the next line, so it will only be executed after you hit enter again.
meaning of this Gnome terminal script
1,564,841,499,000
I am currently using Manjaro (Juhraya 18.1.5) and I use [guake] [1] as a dropdown terminal. I have set a transparency on it and wanted to launch it as a start up program. But after logging in, I find no transparency of the background. Everything else works perfectly fine. If I quit it and relaunch it, transparency works fine. Here are some info that might be useful: System: Host: XD Kernel: 5.4.17-1-MANJARO x86_64 bits: 64 Desktop: KDE Plasma 5.17.5 Distro: Manjaro Linux Graphics: Device-1: Intel Skylake GT2 [HD Graphics 520] driver: i915 v: kernel Display: x11 server: X.Org 1.20.7 driver: intel unloaded: modesetting resolution: 1366x768~60Hz OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2) v: 4.6 Mesa 19.3.3 I found one solution, to add a delay timer in the start-up script. But I was wondering if there was anything more I could do to solve this problem. Also what is causing the problem here? Thanks. [1]: http://guake-project.org/
About my system information... I am using Kubuntu with KDE plasma v:5.18.5. Here is what I did. I installed "gcc" from the terminal window.The "gcc" is a program that translates the C language text code in machine code. I have have created a text file, called "start-guake.c" and then I written the code in that text document(the extension must be ".c" not ".txt"). After that,in the terminal, I changed the directory to the location of the text file and I COMPILED it with "gcc" (in the command line write gcc followed by the path of the text file that contains the code: "gcc /path/to/file.c"). This action resulted in the creation of a file named "a.out" (you will find it in the same folder where you have your text file that contains the code)and this is the actual program. I renamed the file from "a.out" to "start-guake" and moved it in the "/bin/" directory. From there I went to my applications menu and opend "autostart" and in there I added the newly created program. I restarted the computer after all these steps. This is the code: #include <stdlib.h> #include <stdio.h> #include <string.h> void waitTenSeconds(); int main(){ waitTenSeconds(); system("guake"); return 0; } void waitTenSeconds(){ system("sleep 10"); } Hope this helped. Good luck !
Transparency settings for my drop down terminal is not loading at start up
1,564,841,499,000
I installed Solaris 10, but I want change the background terminal color to black. Is there any way to see my text in color mode with vi editor too?
You can change the default colors of your terminal emulator, whether it is dtterm, gnome-terminal or even xterm (reverse-video), using its configuration menu. Solaris 10 standard System V vi doesn't support syntax coloring. You need to install and use vim or elvis to get it.
Change terminal color in solaris 10
1,564,841,499,000
When I press Ctrl + Alt + F1 the desktop environment disappears and a terminal window appears. Pressing Ctrl + Alt + F7 brings me back to DE. This terminal is useful when the DE hangs for some reason and I need to kill a process or something. However the keyboard typing speed in this terminal is so fast that its almost unusable. Attempting to type sudo ps -ef | grep virtualbox often gets me suuudo pss -ef || grep virtuaalbox I have two questions - What terminal is this? Is it Xterm? Could I reduce the keystroke speed to a more usable value, as in gnome-terminal?
What you get when you press Ctrl + Alt + F1 is not Xterm, or anything to do with X or your DE. It is called a TTY (a shortening of TeleType, see here for some history). The command you want is kbdrate. The -d option lets you set the delay before it starts repeating keys, and the -r lets you set the rate at which keys repeat after they've started. You need to run kbdrate as root. Also, not all settings are valid, see the man page for details.
How to change keyboard speed in the Linux console? [duplicate]
1,564,841,499,000
In Gnome Terminal (Version 3.44.1 for GNOME 42), the shortcut ctrl+L clears the terminal (similar to the clear command). There does not appear to be an entry for this in the shortcut preferences. How can I disable it?
You did not tell us what your shell is. Bash Bash uses readline. In your Bash bind -p | grep C-l probably prints: "\C-l": clear-screen (possibly among other lines). To disable Ctrl+l, you need to remove this binding. In Bash the command is: bind -r "\C-l" To disable permanently for Bash, put the above command in your ~/.bashrc. To disable permanently for any tool that uses readline, put the below line in your ~/.inputrc: "\C-l": More information: help bind, man bash, man 3 readline. Zsh Zsh does not use readline. In your Zsh bindkey | grep '\^L' probably prints: "^L" clear-screen (possibly among other lines). To disable Ctrl+l, you need to remove this binding. In Zsh the command is: bindkey -r "^L" To disable permanently for Zsh, put the above command in your ~/.zshrc. More information: man zshzle.
Disable shortcut 'ctrl+L' which clears the terminal
1,564,841,499,000
Recently i switched from kali live to a external drive and installed kali with the installer. I updated everything but since the switch my terminal commands do not turn blue anymore. I have searched for answers and tried to fix this but without results. The steps i tried you can find in the following links: https://askubuntu.com/questions/774424/terminal-has-lost-its-colours https://askubuntu.com/questions/517677/how-do-i-get-a-colored-bash Should look like: instead in my terminal locate it is just white.
In terminal execute: sudo chsh -s /usr/bin/zsh your_username Then, re-login and open terminal again, it should be what you're looking for.
Commands don't turn blue/green in terminal
1,564,841,499,000
I switched a few days ago from xfce4 to cinnamon. Quite an improvement in usability. However, I miss the function of the xfce4-terminal that I can mark text and that it is automatically copied to the cliboard. Wasn't able to find it in the gnome-terminal settings, manual and a startpage-research did not give any results. Is there a way I can make the gnome-terminal (Version 3.36.2) copying text I mark? Or do I need to install the xfce4-terminal for that? Or do you have any other pro suggestions for a terminal-emulator? Thanks.
I found a work-around, which is even better: Anything you highlight in Linux, regardless of the program, is put into a special clipboard buffer, which you can paste using your mouse's middle (wheel) button (which is emulated on many laptops by pushing both buttons at the same time) source https://superuser.com/a/307371/1270261 Bytheway: here is a good compilation of different terminal-emulators https://fossbytes.com/best-linux-terminal-emulators/
Gnome-Terminal mark text > copy to clipboard (like in xfce4-terminal)
1,564,841,499,000
I have an application launcher that executes a command inside gnome-terminal with the -- option, but whenever I go into the terminal and try crtl-z to try to suspend the command and move it to the background nothing happens. My search found a bunch of posts about launching interactive shells in bash, but nothing I've tried there works either. Is there way to launch gnome-terminal and execute a command that gives me the ability to suspend the command and bring up a prompt later?
bash_in_gnome_terminal(){ local IFS printf -v cmd %q ". ~/.bashrc; set -m; $*" gnome-terminal -- bash -c "bash --rcfile <(echo $cmd)" } bash_in_gnome_terminal tail -f ~/.xsession-errors bash_in_gnome_terminal 'grep -r pattern dir | less' This solution is complicated (and crippled!) by the fact that the gnome-terminal command actually calls into a "terminal server" to spawn a terminal instance, and you cannot pass file descriptors to the process running in it. With other terminals like xterm or mlterm the solution is simpler and more functional: bash_in_xterm(){ local IFS xterm -e bash --rcfile <(printf '. ~/.bashrc; set -m; %s\n' "$*") } Also, it would be nice if bash had an option to run some commands before an interactive shell (like vi +'cmd'), without a kludge like --rcfile <(...). Maybe it even has -- but I wasn't able to figure it out ;-) The set -m is needed because bash sources the initialization files with the monitor mode off, ie without job control and the possibility of using ^Z, fg, bg, etc. If you want the shell to exit and the terminal to close when the started command has exited, the function could be modified like this [assumes a recent version of bash]: bash_in_gnome_terminal(){ local IFS set -- 'sigchld(){ local j="\j"; ((${j@P})) || exit; }; trap sigchld CHLD;' "$@" printf -v cmd %q ". ~/.bashrc; set -m; $*" gnome-terminal -- bash -c "bash --rcfile <(echo $cmd)" } The ${var@P} form expands any prompt escapes in var, and the \j prompt escape expands to the number of jobs. Thence j="\j"; ((${j@P})) || exit as called from the CHLD trap will exit the shell if there are no more jobs. In older version of bash which do not support the ${var@P} expansion form, a clunkier kludge will have to be used: set -- 'sigchld(){ trap - CHLD; test "$(jobs -p)" || exit; trap sigchld CHLD; }; trap sigchld CHLD;' "$@" Here the CHLD trap has to be disabled and then reenabled, otherwise the $(jobs -p) command substitution will trigger it recursively. This whole thing could be made into a standalone script instead of a function: #! /bin/bash # uncomment and edit the following line accordingly # set -- <fixed command and arguments> "$@" # this only works in bash >= 4.4 # set -- 'sigchld(){ local j="\j"; ((${j@P})) || exit; }; trap sigchld CHLD;' "$@" set -- 'sigchld(){ trap - CHLD; test "$(jobs -p)" || exit; trap sigchld CHLD; }; trap sigchld CHLD;' "$@" printf -v cmd %q ". ~/.bashrc; set -m; $*" gnome-terminal -- bash -c "bash --rcfile <(echo $cmd)"
gnome-terminal - Execute command with ability to suspend
1,581,875,232,000
Lets say I have top or some ncurses program running in a graphical terminal, and from outside this terminal I'd like to execute a command, that would replace top with another program of my choosing. I imagine there to be a generic approach to this, something that finds the PTY for the correct window kills the program in the terminal, while keeping the PTY Spawns the replacement command, and hooks up PTY I/O to read/write to/from the command My googling for preexisting generic solutions to wrap this has not yielded useful pointers. The specific use-case I have for this: I want to switch the tmux client running in gnome-terminal from one /tmp/tmux-$UID/Socket (=server) to another one belonging to the same user, without "losing" the window. I'm looking for the generic solution, because I could not get a connected tmux-client to connect/attach to a new socket at run-time.
To my knowledge there is no generic solution to do this. The tmux client is running in a pty which belongs to gnome-terminal, you can't change the pty gnome-terminal is talking to or change the program the pty belongs to (either the master or slave end) without gnome-terminal's participation or without some seriously fiddly code (for example, see reptyr, which does the reverse of what you want - moving a program to a different pty rather than a pty to a different program). For tmux specifically, if your tmux is new enough (2.4 or later) you can use detach-client -E to replace the running tmux client with a different process - this could be another tmux client, for example: tmux -Lfirstsocket detach -E 'tmux -Lsecondsocket attach' If your tmux is not new enough, your options are probably limited to: open a new tab in gnome-terminal with the new tmux client and close the original tab; close your gnome-terminal entirely and open another one with the program you want; open the new tmux inside the old tmux and then hide the status line and unset the prefix in the old tmux, so it is still running but won't get in the way.
How to replace program running in graphical terminal with another program?
1,581,875,232,000
compare the following screenshots of terminal
Selecting by default swaps the foreground and background color of the affected cells. (An explicit highlight color can be configured in GNOME Terminal's Prefences, or switched to using the OSC 17 / 19 escape sequences. But let's stick to the default behavior for now.) If a space becomes yellow (orange, brown, whatever that color is :)) when highlighted, it means that its foreground color is this; which, due to the character being a space rather than a letter, is normally not visible. apt maintains a temporary status bar (progress message) at the bottom of its output, erasing and overwriting it with messages that it intends to remain on the screen. You can notice that the text of that status bar is the same color as the highlight one. This means two things: apt removes the status bar's characters by overwriting them with spaces (as opposed to, let's say, a sequence that clears to the end of the line), and it does so before switching back from yellow to the default color. You could file a bug request against apt to change to a more "highlighting-friendly" approach, although I assume it would be handled with extremely low priority. Let alone, other terminal emulators might implement different highlighting experience.
Why are some blank spaces yellow when selected?
1,581,875,232,000
As I'm using bash on my Desktop, I have a multi-tab Gnome Terminal window with 6 to 10 shells opened in there. When I log out of my X session, my ~/.bash_history gets updated in some random way... (at least if you ask me, I have not found a clear pattern to it.) I'm wondering whether all the history from all the shells I had running could be appended. At this time, it feels like only one of the shells will save its history in the file (or rather they all do and the last one wins?) What I think would be best is a way to save commands as I issue them from any one instance. That would certainly be the cleanest, if it's doable, as the order would be preserved (i.e. I cannot type in more than one shell at a time, so saving the history will be in the order I typed command in each shell.)
Check this out : HISTFILESIZE=400000000 HISTSIZE=10000 PROMPT_COMMAND="history -a" shopt -s histappend http://mywiki.wooledge.org/BashFAQ/088
Can we change how bash_history gets updated? [duplicate]
1,581,875,232,000
What I'm trying to do: Load an alias The alias: alias notes='cd ~/project/notes' My system: Ubuntu 16.04 and gnome terminal 3.18.3 In my home directory there are the following bash related files: .bash_history .bash_logout .bashrc .profile I have written this alias in .profile but it is not being loaded. I also created (and later deleted) .bash_profile and put it there, but no luck. Any suggestions?
Edit .bashrc nano ~/.bashrc Add alias notes='cd ~/project/notes' and save file. Run . ~/.bashrc to activate the alias in an existing terminal.
how to load a bash alias for graphical terminal emulator
1,581,875,232,000
I have a folder with symlinks which are pointing to other folders, how can i recursively look into those folders? I would like to do a grep on those results to search for matches. doing tree will only list the symlink as files.
You can use find with the -L option, e.g., find -L . -type f -exec grep foo {} \; That makes find follow symbolic links. Quoting POSIX: -L Cause the file information and file type evaluated for each symbolic link encountered as a path operand on the command line or encountered during the traversal of a file hierarchy to be those of the file referenced by the link, and not the link itself. If the referenced file does not exist, the file information and type shall be for the link itself.
Tree/Find command on symlinks
1,581,875,232,000
This works with xterm (see https://unix.stackexchange.com/a/739977/119816) xterm -e "echo hello; bash" but doesn't with gnome-terminal. What is the equivalent way of doing this with gnome-terminal? gnome-terminal -- "echo hello; bash" Gives this error: I've tried various ways of quoting but no success. Some tries are: gnome-terminal -- "bash -c \"echo hello; bash\"" # gnome-terminal -- /usr/bin/bash /tmp/echo-hi Where /tmp/echo-hi is a shell script that echos hi. And several other variations.
bash -c should not be in the quotation. Try the following: gnome-terminal -- bash -c "echo hello; bash" I am using this one for example: gnome-terminal --window --title "neovim" -- sh -c "nvim" This just executes the nvim binary with sh in a new gnome-terminal window with the title "neovim". In my case sh is just a link to the bash binary. So you can basically use any shell binary you want here.
How do I run gnome-terminal passing in arguments to a command and keeping the command window open and interactive
1,581,875,232,000
I have a script which unexplainably forks a new Terminal instance on some Linux distributions... I'd rather it doesn't do this. Oddly, when I run the script directly (./install.sh) the additional Terminal instance doesn't get created. curl qz.sh | bash # warning this will install a Linux Desktop App you may not want :) On MacOS Mojave: Works normally On Ubuntu 22.04: Works normally in a VM On Fedora 34: Works normally in a VM On Ubuntu 20.10: Reportedly spawns a new terminal On Manjaro XFCE: Works ok until it reaches the sudo ... command in the script and spawns a new Terminal instance Full source code here. The code in question is as follows: # Install using unattended techniques: https://github.com/qzind/tray/wiki/deployment echo -e "Download successful, beginning the install..." case $OSTYPE in "darwin"*) # Assume .pkg (installer) for MacOS sudo installer -pkg "$TEMP_FILE" -target / ;; *) # Assume .run (makeself) for others if which sudo >/dev/null 2>&1 ; then # use "sudo" if available sudo bash "$TEMP_FILE" -- -y else # fallback to "su -c" su root -c "bash '$TEMP_FILE' -- -y" fi ;; esac Question: Why does this spawn a new Terminal instance in some environments and how can I prevent this from happening?
The reason a terminal isn't created when running the installer directly is that makeself uses tty -s to determine whether it's already running in a terminal or not, see the source code on GitHub. When running curl qz.sh | bash you're opening a pipe that's not there when running the script directly, causing the tty -s test to fail. To prevent the terminal from being opened, you can use makeself's --nox11 flag, citing the README: --nox11 : Disable the automatic spawning of a new terminal in X11.
curl pipe script forks a new Terminal window
1,581,875,232,000
When I have a gnome terminal open, is there a command that will allow me to programmatically enquire of this gnome terminal: How many tabs the gnome terminal has open on it? What is the pwd of each of these tabs? I lose my virtual machine in the evening, so I want to write a script to store the above information, and then programmatically reopen all the gnome terminals the next day, upon log in.
You can enumerate the open windows and tabs using dbus; going straight for tabs: dbus-send --session --dest="org.gnome.Terminal" --print-reply /org/gnome/Terminal org.freedesktop.DBus.ObjectManager.GetManagedObjects | grep -c /screen/ will tell you how many are open. If your shell cooperates with VTE, GNOME Terminal will knows about the last current directory for each running shell in your tab (not the current directory of the leaf process running in each tab, if it’s not the shell); but I don’t think there’s a way to retrieve that over the bus. What you can do is list the current working directories of all the “leaf” processes whose parent is GNOME Terminal: pstree -T -p $(pgrep gnome-terminal) | sed -E 'sX^.*\(([0-9]+)\)$X/proc/\1/cwdX' | xargs readlink -f This won’t tell you which tab is where but I’m not sure that’s significant (as far as I can tell, there’s no way to determine what each tab is running). You can use variations of this to find out what is running too, not just the current working directories.
What commands will allow me to programmatically enquire of a gnome terminal: how many tabs it has, and what are their pwd's
1,581,875,232,000
i have a script to launch gnome terminal with multiple tabs. The tabs are opened based on a list of directories listed in .tabs file that are in the same dir as the script. I create a string with several --tabs --working-directory /some/dir one for each line in the tabs file. before i run the command i echo it to the console. then i actually run it. Problem is gnome does open the tabs but it doesn't open each one in it's working directory. However if i copy-paste what i printed to the console it works great. i can't figure out why. here is the script: #!/bin/bash SCRIPT_DIR=$(dirname $(readlink -f $0)) declare -a profiles_list=() while [[ "$1" != "" ]] do profiles_list+=($1) shift done if [[ ${#profiles_list[@]} -eq 0 ]] then profiles_list+=("TERM_DEFAULT") fi TERM_LIST_PARAM="" for profile in ${profiles_list[@]} do file="${SCRIPT_DIR}/${profile}.tabs" if [[ ! -f $file ]] then echo $file does not exists fi while read tab do tab_line="--tab --working-directory='${tab}'" TERM_LIST_PARAM="$tab_line $TERM_LIST_PARAM" done < $file done echo gnome-terminal ${TERM_LIST_PARAM} gnome-terminal -v ${TERM_LIST_PARAM} echo $? exit 0
Use arrays for storing separate arguments. Using strings makes the shell confused when it later tries to split them up on whitespaces. TERM_LIST_PARAM=( ) Followed by, tab_line=( --tab --working-directory="$tab" ) TERM_LIST_PARAM=( "${tab_line[@]}" "${TERM_LIST_PARAM[@]}" ) # or: TERM_LIST_PARAM+=( "${tab_line[@]}" ) Then, gnome-terminal -v "${TERM_LIST_PARAM[@]}" Additionally, you must double quote $0, $1, $file, and ${profiles_list[@]} in your code, or you'll run into issues as soon as any of these values contains spaces and/or globbing characters. See also: How can we run a command stored in a variable?
gnome-terminal doesn't open tabs properly from my script
1,581,875,232,000
I currently work in hardware development, at present frequently connecting/disconnecting/rebooting device(s) connected to the serial ports. (Usually just /dev/ttyUSB0) I have a basic script to monitor the serial port, which runs in its own small gnome-terminal window in one corner of my screen, so I can "at-a-glance" easily see if a device is connected, or has finished rebooting etc. This window is visble all the time. for monitoring purposes. The script (monitorSerialPorts) is basic but functional: while [ true ] do clear printf "\n Serial Devices: " ls /dev/ttyUSB* 2> /dev/null || (clear ; printf "\n No Devices Detected") sleep 2 done And I call this script from a second script (monitorSerialPortsLauncher), that runs upon login, the contents is just one line, which creates a small window nicely where I need it: gnome-terminal --window-with-profile=RedonYellow --command=$HOME/scripts/monitorSerialPorts --geometry=26x3-20 Question: is there a clean way to combine this functionality in to a single script? (Also, any overall suggestions for improvements to this process or script are welcomed)
You can put in this script in your monitorSerialPortsLauncher #!/usr/bin/env bash script=/tmp/monitorSerialPorts cat << 'EOF' > $script #!/usr/bin/env bash sleep 10 while true do clear printf "\n Serial Devices: " ls /dev/ttyUSB* 2> /dev/null || (clear ; printf "\n No Devices Detected") sleep 2 done EOF chmod 755 $script gnome-terminal --window-with-profile=RedonYellow --geometry=60x6-20 --command="$script"
How to pass a script to gnome-terminal in one file?
1,581,875,232,000
I'm using Gnome 3.30 and beyond org.gnome.Terminal.desktop, I have two additional .desktop files with Exec=gnome-terminal --window-with-profile=XXX, where profile XXX uses custom command ssh kalle@XXX, so I can easily open terminals to work on my other machines. What I don't like, especially when working with multiple terminal windows for each of the local and the other machines, is the fact that all windows are associated with the icon of org.gnome.Terminal.desktop. Is there a way to get each window associated with the icon it belongs to? BTW: I had the same issue when I started using an Eclipse version that was still under development. To be safe, I kept the previous, stable version and created another .desktop file for the new one. When I started both to copy and paste the software sites from the old to the new one, both windows were associated with the icon of the old one, although, as opposed to the gnome-terminal issue, these were different applications. Even renaming one of the two executables didn't change anything.
I found a solution. Since 'org.gnome.Terminal' sounds like a D-Bus service name, I took a look at the syslog after opening a terminal. The important part is: dbus-daemon: Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' I speculated that creating a new service with name 'org.gnome.Terminal.XXX' and renaming the .desktop file for machine XXX to 'org.gnome.Terminal.XXX.desktop' would do the trick, but in fact, the name of the .desktop file doesn't matter. The steps are as follows: Create new D-Bus service sudo cp /usr/share/dbus-1/services/org.gnome.Terminal{,.XXX}.service Modify entries Name=org.gnome.Terminal.XXX SystemdService=gnome-terminal-server-XXX.service Exec=/usr/lib/gnome-terminal/gnome-terminal-server --app-id org.gnome.Terminal.XXX Create new Systemd unit sudo cp /usr/lib/systemd/user/gnome-terminal-server{,-XXX}.service Modify entries Description=GNOME Terminal Server XXX BusName=org.gnome.Terminal.XXX ExecStart=/usr/lib/gnome-terminal/gnome-terminal-server --app-id org.gnome.Terminal.XXX Update .desktop file Exec=gnome-terminal --window-with-profile=XXX --app-id org.gnome.Terminal.XXX The --app-id option is crucial for our service name to be used instead of the built-in one.
Gnome: Possible to get each instance of an application associated with the icon which was used to start it?
1,581,875,232,000
Backstory: I'm working with a piece of software that uses CMake for several build options. On my desktop build system when I execute a 'Processor Reset' command the program exits cleanly, but needs restarted with a different set of parameters. (The functionality works correctly on hardware, so I do not wish to modify the underlying source whatsoever.) Question: My question is, how can I monitor the terminal output from the program, and upon seeing "Processor Reset Received", trigger a new instance of the program? Caveats My preferred answer would perform this in a shell script, but I'm open to other ideas. I do not wish for there to be any recursion. General Flow Start the program with a Power-On Reset ./program -PO (Program runs and prints output to terminal) Send a Processor Reset Command Program receives Processor Reset Command, prints relevant information, and terminates Monitor program reads that the original program has terminates with a Processor Reset, and runs the program again with different flags. ./program -PR Things I've tried I have a partially working solution that... is interesting. It appears that there is some weird buffering going on which I've tried to disable, albeit unsuccessfully. But - it does successfully parse the program's terminal output and execute the Processor Reset flags when necessary (albeit once, as it is not in a loop.) stdbuf -o0 -i0 -e0 sudo ./program -PO | tee /dev/tty | (grep "Processor Reset.") | (read && sudo ./program -PR) To recap I need the code to not buffer large chunks of data (i.e. write smoothly as it produces output) It should be wrapped in a loop to allow multiple Processor Resets. (Any other reset should terminate the loop.)
Thanks to slm for pointing me in the right direction! # Start the program with Power-On Reset # Use tee to print output to terminal and pipe to grep # grep returns 0 if the string is found sudo ./program -PO | tee /dev/tty | grep -q "Processor Reset." # Store the grep exit code in a variable result="$?" # If result is 0, grep found the Processor Reset string if [ "$result" == "0" ]; then while : ; do sudo ./program -PR | tee /dev/tty | grep -q "Processor Reset." result="$?" # This loop will continue as long as the Processor Reset string is found # once the program terminates [ "$result" == "0" ] || break done fi
Restarting an executable based on terminal output
1,581,875,232,000
I tried this: x-terminal-emulator --command="printf 'New terminal emulator is opened for input'" But it only opens the terminal window without printing anything! If I tray: gnome-terminal --command="printf 'New terminal emulator is opened for input'" it does nothing!
Try: gnome-terminal -x sh -c 'printf "New terminal emulator is opened for input\n"; exec bash' Source and more things you may be interested about here: https://superuser.com/a/198022/755698 An alternative is : gnome-terminal -e 'sh -c "printf \"New terminal emulator is opened for input\n\";sleep 10"' In the first case, the terminal will remain open and wait for commands...In the second it will wait for ten seconds before close...
How to open new gnome-terminal that launches a command?
1,581,875,232,000
My python script containing import matplotlib.pyplot as plt was not working and one of my classmate suggested to remove one of the python packages. (My dell ubuntu 12.04 desktop has two python programme 2.7 and 3) So, I run the command sudo apt-get remove python. Now my terminal and unity launcher is missing. How can I recover everything without reinstalling? I can login in tty . Thank you in advance. (P.S. I understand removing python was a bad idea)
try sudo apt-get install ubuntu-desktop that should install the base meta-package with all the dependencies,but since you are using 12.04, if that does not work, try: sudo apt-get update && sudo apt-get dist-upgrade
Terminal and unity launcher is missing
1,581,875,232,000
My Antergos terminal doesn’t show me any colors when executing scripts. I have a fresh instalation, with no tweaks. I have zsh and oh-my-zsh, but the configurations are the default ones. You can see that all the output is white, it should be colorful: This happen when I install programs, blanks spaces are text: Selectable text: ➜ ~ yaourt gnome-terminal 1 extra/gnome-terminal 3.18.2-1 (gnome) [installed] The GNOME Terminal Emulator 2 aur/gnome-terminal-dark-variant 3.18.2-1 (10) The GNOME Terminal Emulator - Patched to bring back 'Use dark theme variant' option in preferences 3 aur/gnome-terminal-fedora 3.18.2-1 (31) The GNOME Terminal Emulator with Fedora patches 4 aur/gnome-terminal-git 3.15.91.5228.e5f7763-1 (2) The GNOME Terminal Emulator. Git Version 5 aur/neovim-gnome-terminal-wrapper 2-3 (0) A wrapper for running neovim in a separate instance of gnome-terminal ==> Introduzca el número de los paquetes desea instalar (ejemplos: 1 2 3 ó 1-3) ==> --------------------------------------------------------------------------- ==> I tried to customize the profiles, with no success, I tried a fresh instalation with the same ISO in my laptop with no problems, but I don't want to reinstall Antergos in this machine. tput colors outputs 256
The problem appears to have been fixed, but the cause was a hardcoded check for the TERM environment variable equal to xterm. If (as indicated in the question) you had xterm-256color, then the check would fail. You can see one of the diff's which is part of the change to fix this problem in the git repository, in this chunk of deleted lines: - /** - * Returns whether we are a terminal and have colour capabilities - * - * @return bool - */ - private function isColorTerminal() - { - if (function_exists('posix_isatty')) { - $result = posix_isatty(STDOUT); - } else { - // See if STDOUT is a character device (S_IFCHR) - $stat = fstat(STDOUT); - $result = ($stat['mode'] & 0170000) === 0020000; - } - - if (defined('PHP_WINDOWS_VERSION_BUILD') && $result) { - $result = false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - return $result; - } -
Terminal doesn't print colors
1,581,875,232,000
I have CentOS 7 running as a guest OS inside a VirtualBox host. I opened a terminal to write some commands, but the colors are all messed up as shown in the following print screen: It looks like text is highlighted, but the light blue against white background makes it nearly impossible to read. How can I restore the black text on white background so that I can read the terminal? White text on black background would be equally good. I just need high contrast between text and background to be able to read.
Add this to last line of your ~/.bashrc: unalias ls and type source ~/.bashrc
why are colors mixed up in CentOS 7 terminal?
1,581,875,232,000
I just broke my gnome-terminal. At the options I tried to force my terminal to open with 256 colors adding the command: export TERM=xterm-256color but now my terminal open and exits immediately. How can I remove this command?
Try to run gnome-terminal -x sh or gnome-terminal -e bash (from xterm or directly as command by Alt+F2) and you will get gnome-terminal with sh/bash. Then after Go to: Profiles > Profile Preferences > Command > Custom command (where you've set export TERM=xterm-256color) and make correction
gnome-terminal broke after adding command to initialize
1,581,875,232,000
OS: Kali Linux version 1.1.0 gnome version 3.4.2 Using screen, I press CTRL + a and | but nothing is being split. Only the words "No other window" appears in the bottom. Here is other things I tried CTRL + a and capital S CTRL + a and b CTRL + a and c CTRL + a and | (Pipe key) none of the above fixed it for me What am I doing wrong?
Try, in sequence: CTRL+a, | # create a new pane CTRL+a, <TAB> # goto the new pane CTRL+a, c # start a new shell in the pane
can't split terminal using screen
1,581,875,232,000
Eve though in dconf the profiles i installed are shown > dconf list /org/gnome/terminal/legacy/profiles:/ :3fab5042-3b59-44c2-b86e-df287109b3d7/ :93be6823-4719-4dea-be06-ebf0ae9091d8/ :Aci/ :Wild-cherry/ :b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ default list In my terminal preferences they are not shown so that i can change the profile How can i resolve this issue, also i must say that i changed the curent value of profile in the dconf editor as another profile but still nothing in effect. Also i must say that after i manually add profiles with the '+' button in the terminal preferences, if i add a new profile with "gogh" all the profiles i created manually are deleted, just the default profile left.
Okay i found a solution. The problem was with the wrong uuid format like @egmont said. The solution was to export the profiles with dconf dump from another working machine and get the right uuid, than importing those profiles with dconf load. After that i just added those uuids in the /profiles:/list. Ant there was the profiles in the preferences. Thanks for all the replies
Terminal Profiles not being loaded
1,581,875,232,000
I just checked my timings: it takes about 0.41-0.45 seconds to open a new gnome-terminal window and about 0.55-0.65 seconds to open kitty. And it does bother me a bit that it takes so much time to open (I want it to be close to instant, like UI elements are responding to mouse/keyboard events). I want some suggestions for either speeding up window open process or some terminal alternatives that open faster (I use kitty for several years now). Maybe someone can share their timings, so I can compare mine to something (I didn't find anything about this issue on the Internet). Here's a MWE: terminal=kitty # gnome-terminal date +%s.%N > .start; $terminal -- sh -c 'echo "$(date +%s.%N)-$(cat .start)" | bc | cut -c 2- > .diff; rm -f .start'; cat .diff; rm -f .diff My config: Laptop with i7-8550U, SSD, Ubuntu 20.04. P.S. I'm hoping soon to hop to Pop!_OS 22.04. After that, I'll check my timings again (perhaps they'll improve). Update: Tried with zero config using root: kitty: 0.38-0.43 seconds gnome-terminal: 0.41-0.46 seconds Update 2: Run ranger using kitty with root (0 conf.) and alacritty (cargo crate is user-wide; 0 conf.): kitty: 0.50-0.57 seconds alacritty: 0.37-0.43 seconds alacritty without ranger: 0.22-0.28 seconds (now we're talking) kitty: date +%s.%N > .start; kitty ranger --cmd 'shell echo "$(date +%%s.%N)-$(cat .start)" | bc | cut -c 2- > .diff; rm -f .start; kill $PPID'; cat .diff; rm -f .diff alacritty: date +%s.%N > .start; alacritty -e ranger --cmd 'shell echo "$(date +%%s.%N)-$(cat .start)" | bc | cut -c 2- > .diff; rm -f .start; kill $PPID'; cat .diff; rm -f .diff P.S. I use ranger a lot (want to switch to lf) and 99% I open it with a shortcut bound to kitty ranger command.
I found out that only kitty (among those who I tested) can support ligatures. And looking at how it improves, I don't think anything can substitute it for me. And after some research, I found that (probably on a lot more speedy PC) some people manage to open kitty in 0.2s (0.1s to load OpenGL and 0.1s for the rest). Also, I fortunately found that kitty does support "server-client" architecture. You can create any number of groups in which terminals share some stuff (I don't have any specifics). And to create "the main" (the easiest) group, I only had to add 3 more chars: kitty -1: --single-instance, -1 If specified only a single instance of kitty will run. New invocations will instead create a new top-level window in the existing kitty instance. This allows kitty to share a single sprite cache on the GPU and also reduces startup time. You can also have separate groups of kitty instances by using the --instance-group option. Now the terminal (fully customized) opens in less than 0.2s (0.16-0.18)! That's 0.4s or 3.3 times faster than my first timings. It's about as fast as other server terminals (gnome-terminal, xfce4-terminal). There are only 2 downsides: I don't think there's a way to run server in background, therefore 1st terminal opens with regular speed (0.57s); If you kill one terminal (maybe something did freeze) — the other ones all go with it. But currently I think these things aren't an issue for me and I probably can live with them. I installed Pop!_OS 22.04 and the UI is super responsive (I really think it will decrease the time even further).
Time it takes to open a new terminal window
1,671,262,826,000
I am trying to create a bash script that will set up my all development stuff in an instant. What I want the script to do: open 5 different tabs in one window. clear terminal and start firefox-esr. clear terminal and run top command. clear terminal and start development server by using npm live-server. edit a file by using vim. for testing purpose only. Here is what I have so far: #!/bin/sh qterminal --tab #clear && top When I try to open new tab using command I got this error: qterminal: unrecognized option '--tab' How can i open new tabs in terminal by using commands?
I just end up by installing gnome-terminal and remove qterminal. Qterminal does not support this --tab option. Script current look #!/bin/bash gnome-terminal --tab --hide-menubar --title="Firefox-esr" --working-directory ~/workshop -- firefox-esr gnome-terminal --tab --hide-menubar --title="Server" --working-directory ~/workshop/methodTwo/reference/reactMainConcepts/ -- live-server --open=./index.html gnome-terminal --tab --hide-menubar --title="Current Js" --working-directory ~/workshop/methodTwo/reference/reactMainConcepts/ -- vim gnome-terminal --tab --hide-menubar --title="Side Js" --working-directory ~/workshop/methodTwo/reference/reactMainConcepts/ -- vim clear && top And i added this in ~/.bashrc # function to set terminal title function setTitle() { if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$*\a\]" PS1=${ORIG}${TITLE} #askUser } setTitle Testing function askUser(){ ~/workshop/devSetup.sh } setTitle function is not my own created function. I copied it from this ask ubuntu answer. Now i can use my development setup by using this command askUser. If something is wrong in this answer please tell me it will fix it as soon as possible. Thank you!
how to open multiple new tabs in qterminal with a bash script in debian 11 lxqt
1,671,262,826,000
Is there any way to change Gnome-terminal settings, such as transparency, globally, so that I won't have to set it again and again after restarting i3-wm? I'm using Regolith Linux.
If anyone is interested, I've figured it out. Only thing you need to do is insert these two lines into your Xresources file: gnome.terminal.use-transparent-background: true gnome.terminal.background-transparency-percent: [some number]
Changing the preferences of Gnome-terminal globally
1,671,262,826,000
I'm trying to change the color of "[shark@Archshark ~]$" to blue in the terminal but It seems that I can't change it, please help.
The prompt colour is governed by your shell configuration files. Assuming you use Bash, you can change the propmt colours in .bashrc or .bash_profile files in your home directory. I believe, judging by your prompt, you use Arch Linux, so you may find some information on prompt colours here. For other common shells, look here.
How to change the color of this selected text of the gnome terminal?
1,671,262,826,000
I am on several machines running Linux Mint 20.1 "Ulyssa" - Cinnamon (64-bit), link to web, with Bash 5.0.17 as my default shell. Today, I decided I customize my prompt and window title of my terminal emulator, which is GNOME Terminal. I've known from the past this can be done for example per user in their .bashrc file. As every computer has only one user + root, I went this way, I carefully read every line, to be honest, changed comments mostly. I managed to identify and change colors to my liking. Also, the spacing where I wanted. Relevant PS1 lines: # Prompt: # user @ host : full_path if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u \[\033[00m\]@ \[\033[01;34m\]\h\[\033[00m\] : ${PWD} \$ ' else PS1='${debian_chroot:+($debian_chroot)}\u @ \h : ${PWD} \$ ' fi # Set the window title to the same as prompt case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u @ \h : ${PWD} \a\]$PS1" ;; *) ;; esac So, the only thing remaining, which I fail on for hours, is setting the Terminal window title caption, it seemingly works upon launch, but does not change if changing directory. My apologies if it is messed up. I just want it to show a full path (no tilde) wherever I am. Thank you. Picture for the words (terminal title-bar caption not updating):
For a reason unknown to me, it was only necessary to escape the $ (dollar sign) in front of PWD in the window title definition on this one line: xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u @ \h : \$PWD \a\]$PS1" ;; I tested it somewhat and now preparing to deploy it on all machines.
Full path in terminal prompt and title-bar with modified PS1 in .bashrc
1,671,262,826,000
When Starting Fedora linux after uninstalling / removing Cinnamon Desktop Environment I got login screen but after trying to log in I got black screen in Gnome and KDE . After that I tried to go in tty and try to issue any command but , I got this dnf command not found , ls command not found message / error . SCREENSHOT But When I was First Rebooted My PC after removing Cinnamon Desktop Environment , I just entered in Gnome , But only some 5-6 software like chrome were available and software like settings , nautilus , terminal were not available . But now Gnome or any desktop environment is only showing the black screen . And Currently Cinnamon Flavour is available, even after deleting it . SCREENSHOT I browsed on internet but i didn't found solution .
Looks like your profile is busted. Login under root and create a new user account. Copy/move your old data from the old user to the new one. If you don't remember root password reboot and add init=/bin/bash as a kernel command line argument, issue passwd, set a new root password, run sync and then reboot. Alternatively, do this in a terminal (granted you're in your user directory - check using pwd - you should see something like /home/username): /bin/mkdir BACKUP /bin/mv * .* BACKUP /bin/cp -a /etc/skel/* . Now you must be able to login into your graphical DEs.
Black Screen , no command found in fedora
1,671,262,826,000
I've installed gnome-terminal and xorg-server-xwayland and now I am trying to launch gnome-terminal. I already had an error caused by keycodes above 255. I deleted the keycodes above 255 and the problem get resolved but I've got an other problem : [...] glamor: No eglstream capable devices found [...] # Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0 : Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached" Anyone has an idea to solve this ? May usefuls infos: OS: ArchLinux Kernel release: 5.2.8-arch1-1-ARCH X Server : Wayland Compositor : Sway
I found my problem with the help of https://askubuntu.com/questions/608330/problem-with-gnome-terminal-on-gnome-3-12-2 . I didn't set my locale correctly, I put "lang" instead of "LANG" in my /etc/locale.conf ^^' When I've set it correctly, I just reboot my computer and it works !
Error when launching gnome-terminal on Sway
1,671,262,826,000
I am unable to determine the cause of this, but the day prior when using su to enter my password for installing an application through the terminal, the authentication has been successful. So far, I am uncertain on how to resolve this issue. I use a Fedora 29 GNOME OS. [Machine-Replicator@localhost ~]$ su Password: su: Authentication failure
The su command does not accept your password. You must use the target user's password, which in your example shown is the root password. Are you perhaps muddling su with sudo, which does take your own password for authentication?
Using su results in the message: Authentication failure on Fedora 29
1,671,262,826,000
Whenever I open the (Gnome) terminal from my Fedora 26 system this line is being displayed first before the command prompt: -bash: /home/kiran/AIPS/LOGIN.SH: No such file or directory I understand that on each start up the terminal is trying to read the above mentioned file. I find this irritating. Why is this happening? (PS: AIPS was a software I had installed previously. After installing it I was not being able to open the system settings. The installation was incorrectly overriding the system libraries and hence I removed it. This warning that I am getting seems to be an artifact from that AIPS installation)
Based on one person's installation guide I suspect you have an AIPS-related line in your ~/.bashrc file; edit that file and remove the line that reads something like: . ~/AIPS/LOGIN.SH It could use variations such as: source ~/AIPS/LOGIN.SH or source $HOME/AIPS/LOGIN.SH Search for the text AIPS/LOGIN.SH and you should find the right spot.
Bash terminal trying to read a previously installed file on each start up
1,671,262,826,000
i want to open a new terminal and execute a script immediately to it (to set a title in the new tab) and i cannot configure this. I try: gnome-terminal --tab-with-profile=$varname -x ./test.sh -c "script -a -c 'ping $varname' $PATH_REPORT/$varname.log" Any help how can i execute the test.sh script which contains: PROMPT_COMMAND='echo -ne "\033]0;${varname}\007"' with the others in command i wrote?
You can simplify your solution so that you only need to specify the hostname once. The test.sh script can set the prompt directly with the echo command and then run the ping you want. $ cat test.sh #!/bin/bash echo -ne "\033]0;$1\007" script -a -c "ping $1" $PATH_REPORT/$1.log Now you can call this with gnome-terminal -x ./test.sh $varname (make sure PATH_REPORT is set in the script before hand,or exported from the current shell) If you want more complicated executions then you can adjust the test.sh script as you need.
Execute script in new tab command line gnome-terminal
1,671,262,826,000
I'm new to scripting, but somewhat familiar with Linux. I am actually using this on a Fedora16 build, with Gnome3 and gnome-terminal... fyi. I flip through all sorts of ssh terminals all day long and I thought it would be nice to create a ssh script called lambda that contains information that is sent to a terminal_wrapper script that accepts all sorts of variables and creates a new gnome-terminal based on those given variables. The information I would like would be to rename the title, change bg and fg colors, and start an ssh in a new gnome-terminal window. I feel like I'm close to getting the ssh to work, but I'm missing something. Here is what I've got for my ssh script for lambda: terminal_wrapper user lambda.company.com And here is my terminal_wrapper: gnome-terminal --title=$2 -e ssh $1 $2 It opens a new window for me, renames it to the lambda.company.com, and then sits there and closes after a second. Any help? Thanks.
Please, use this command: gnome-terminal --title=$2 --command "ssh $1@$2" --window &
Creating SSH Terminal Wrapper
1,671,262,826,000
I would like to capture the stdout (as sent to a terminal), and perform some processing after it is output on the terminal (for the user). I want to know how to grab the output, process and make changes accordingly. (If possible) I want this to happen for every command I type on the terminal. Edit: After a dialogue in a temporary chat forum it was clear that we should both look for which commands are issued and what output there is from the commands and do something, if a particular command or output is detected.
Well, maybe it is not a good idea to grab the output, process and display the output of every command you type on the terminal. But you can do it for some particular command via tee your-command | tee saved-output | processing-tool When you have seen the result from the processing-tool, you can look at the saved-output for example with cat (if short output) or less (if long output). Example: $ LANG=C sudo lshw | tee saved-output | grep -i -A2 disk *-disk description: ATA Disk product: KINGSTON SKC300S physical id: 0.0.0 -- *-disk description: ATA Disk product: WDC WD4002FYYZ-0 vendor: Western Digital $ less saved-output After a dialogue in a temporary chat forum , I suggest to try vialog or viafifo according to the following links maybe modify one of them to do what is expected in this case, both look for which commands are issued and what output there is from the commands and do something, if a particular command or output is detected. Send a notification or alert when bash asks for input from user This link to AskUbuntu It works directly to use vialog like the following example. vialog 2>&1 | tee saved-output | grep 'docker container ls' && echo 'it was mentioned' In the real case, I think you would like to start something more advanced than echo 'it was mentioned', but this is only a demo example. And things can be more efficient, if you build the specific checks into vialog and disable the alerts, that are probably not necessary in your case. Screenshot during the dialogue: Screenshot after the dialogue: This way you can easily check if a command that is called is not found: $ LANGUAGE=C vialog 2>&1 | tee saved-output | grep -i 'Command.*not found' && echo 'it was mentioned' Command 'docker' not found, but can be installed with: it was mentioned $ cat saved-output ----- start vialog at 2019-01-12 18:57:33 ---------------------------- $ docker container ls Command 'docker' not found, but can be installed with: sudo apt install docker.io $ exit exit ------- end vialog at 2019-01-12 18:58:01 --- used 28 seconds
Capture output of a command, process it and ONLY then output to terminal
1,671,262,826,000
I have written a shell script named startup.sh which does a lot of things (basically start a lot of things for me after turning on my local machine) - here is an excerpt: #!/bin/bash gnome-terminal --tab & veracrypt --auto-mount favorites & thunderbird & ~/Application/IDEA/bin/./idea.sh & /usr/bin/slack & echo myuser mypass | skypeforlinux --pipelogin & sh bsync-project-folder.sh & exit Open a console window and do: . startup.sh The shell script is executed and the window is closed afterwards. Also working: sh startup.sh OR ./startup.sh The shell script is executed and the terminal window stays open - however it does not return to the console and have to stop script execution with CTRL + C (no matter if I execute with the command line interpreter or with ./). However I want a clean exit of my script and then return to the same console with a success message. What am I missing?
When you start a script with '< dot> < space> < script_name>' and you have in your script "exit", your window will be closed. The dot notation means you run it within the window and then the "exit" means to exit the window, not the script itself. Try to add >/dev/null 2>&1 to each of the line (before final &) to find out which of the commands still holds stdout, eg.: gnome-terminal --tab >/dev/null 2>&1 & ... you may but need not to leave the exit at the end but it does not have any sense here. Run the script: ./startup.sh
How to properly write and execute a shell script and exit correctly? [duplicate]
1,671,262,826,000
When I open gnome-terminal, instead of presenting me with my default Bash shell, it shows: sh-4.4$ This began happening since I added DISPLAY=:0 to my crontab -e file which now looks as follows: DISPLAY=:0 0 0,6,12,18 * * * /usr/bin/gnome-terminal -e /home/orschiro/bin/updates.sh 0 0,6,12,18 * * * /usr/bin/gnome-terminal -e /home/orschiro/bin/rclone.sh And also of interest: sh-4.4$ ls -l /bin/sh lrwxrwxrwx. 1 root root 4 18. Jun 10:30 /bin/sh -> bash
I'm assuming this is the gnome-terminal started from your cronjob. There is absolutely no need to run the cronjob scripts inside gnome-terminal. Doing so would mean that the jobs would fail if gnome-terminal could not be opened (which would probably happen if you weren't using the desktop at the time). Just use 0 0,6,12,18 * * * "$HOME"/bin/updates.sh 0 0,6,12,18 * * * "$HOME"/bin/rclone.sh Any output from the scripts will be emailed to you, assuming local email delivery was enabled. To save the output to a log file, use a redirection: 0 0,6,12,18 * * * "$HOME"/bin/updates.sh >>"$HOME"/updates.log" 0 0,6,12,18 * * * "$HOME"/bin/rclone.sh >>"$HOME"/rclone.log" The environment that the cronjobs are running in is different from the one you usually have when logged in through a graphical desktop environment. For one thing, your default shell may not be set in the SHELL environment variable, which is why gnome-terminal starts /bin/sh instead of bash (sh is bash on your system, but runs in POSIX compatibility mode when invoked as sh). When logged in on the graphical desktop environment, opening gnome-terminal as usual would give you your default shell. If it doesn't, it's because there's a gnome-terminal-server process running which was started by the cron jobs. Terminate this process by either rebooting or by using pkill -f gnome-terminal-server. See also the comment posted by JdeBP below.
sh-4.4$ how to log back into my default shell terminal?
1,339,090,327,000
I use screen for my command-line tasks while managing the servers where I work. I usually run small commands (mostly file-system tasks) but sometimes I run more extensive tasks (like DBA). The output of those tasks is important to me. Since I use Ubuntu and OS X (both Terminal Windows) for my tasks, yet I need to use screen, the scrolling is not available, so any long output (think a 500-row table from a select) is invisible for me. Mouse-wheel is out of the question. When I say "scroll is invisible for me, I mean this: I was thinking about two options: Pause (think paginate) the output of a certain command. When the output begins, it would let me read what's happening, then I press "Enter", then the output continues until there's nothing more to show. Scroll inside screen. But I don't know if this is possible. Of course, I don't know if those options are actually possible. If they are, how can achieve them? Other alternatives will be well received.
Screen has its own scroll buffer, as it is a terminal multiplexer and has to deal with several buffers. Maybe there's a better way, but I'm used to scrolling using the "copy mode" (which you can use to copy text using screen itself, although that requires the paste command too): Hit your screen prefix combination (C-a / control+A by default), then hit Escape or [. Move up and down with the arrow keys (↑ and ↓). When you're done, hit any key except arrow keys, numbers, and certain letters to get back to the end of the scroll buffer. Most people use q or Escape (If instead of exiting you press Enter or Space and then move the cursor, you will start selecting text to copy, and pressing Enter or Space a second time will copy it. Then you can paste with C-a followed by ].) Of course, you can always use more and less, two commonly used pagers, which may be enough for some commands.
Scroll inside Screen, or Pause Output
1,339,090,327,000
From vi, if you issue the command :sp, the screen splits into two "views", allowing you to edit more than one file from the same terminal. Along those same lines, is there a way to have multiple shells open in the same terminal?
You can do it in screen the terminal multiplexer. To split vertically: ctrla then |. To split horizontally: ctrla then S (uppercase 's'). To unsplit: ctrla then Q (uppercase 'q'). To switch from one to the other: ctrla then tab Note: After splitting, you need to go into the new region and start a new session via ctrla then c before you can use that area. EDIT, basic screen usage: New terminal: ctrla then c. Next terminal: ctrla then space. Previous terminal: ctrla then backspace. N'th terminal ctrla then [n]. (works for n∈{0,1…9}) Switch between terminals using list: ctrla then " (useful when more than 10 terminals) Send ctrla to the underlying terminal ctrla then a.
How to split the terminal into more than one "view"?
1,339,090,327,000
I am working on a remote Debian Jessie server. I have started a screen session, started running a script, then been disconnected by a network timeout. Now I have logged in again and want to resume the session. This is what I see when I list screens: $ screen -ls There are screens on: 30608.pts-8.myserver (11/03/2015 08:47:58 AM) (Attached) 21168.pts-0.myserver (11/03/2015 05:29:24 AM) (Attached) 7006.pts-4.myserver (10/23/2015 09:05:45 AM) (Detached) 18228.pts-4.myserver (10/21/2015 07:50:49 AM) (Detached) 17849.pts-0.myserver (10/21/2015 07:43:53 AM) (Detached) 5 Sockets in /var/run/screen/S-me. I seem to be attached to two screens at once. Now I want to resume the session I was running before, to see the results of my script: $ screen -r 30608.pts-8.myserver There is a screen on: 30608.pts-8.OpenPrescribing (11/03/2015 08:47:58 AM) (Attached) There is no screen to be resumed matching 30608.pts-8.myserver. Why I can't I re-attach? I have the same problem with the other screen: $ screen -r 21168.pts-0.myserver There is a screen on: 21168.pts-0.OpenPrescribing (11/03/2015 05:29:24 AM) (Attached) There is no screen to be resumed matching 21168.pts-0.myserver.
The session is still attached on another terminal. The server hasn't detected the network outage on that connection: it only detects the outage when it tries to send a packet and gets an error back or no response after a timeout, but this hasn't happened yet. You're in a common situation where the client detected the outage because it tried to send some input and failed, but the server is just sitting there waiting for input. Eventually the server will send a keepalive packet and detect that the connection is dead. In the meantime, use the -d option to detach the screen session from the terminal where it's in. screen -r -d 30608 screen -rd is pretty much the standard way to attach to an existing screen session.
Can't resume screen, says I am already attached?
1,339,090,327,000
Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.
From their website: How is tmux different from GNU screen? What else does it offer? tmux offers several advantages over screen: a clearly-defined client-server model: windows are independent entities which may be attached simultaneously to multiple sessions and viewed from multiple clients (terminals), as well as moved freely between sessions within the same tmux server; a consistent, well-documented command interface, with the same syntax whether used interactively, as a key binding, or from the shell; easily scriptable from the shell; multiple paste buffers; choice of vi or emacs key layouts; an option to limit the window size; a more usable status line syntax, with the ability to display the first line of output of a specific command; a cleaner, modern, easily extended, BSD-licensed codebase. There are still a few features screen includes that tmux omits: builtin serial and telnet support; this is bloat and is unlikely to be added to tmux; wider platform support, for example IRIX and HP-UX, and for odd terminals.
tmux vs. GNU Screen [closed]
1,339,090,327,000
I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back. One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there. Is there a different way to proceed?
You can revoke “ownership” of the program from the shell with the disown built-in: # press Ctrl+Z to suspend the program bg disown However this only tells the shell not to send a SIGHUP signal to the program when the shell exits. The program will retain any connection it has with the terminal, usually as standard input, output and error streams. There is no way to reattach those to another terminal. (Screen works by emulating a terminal for each window, so the programs are attached to the screen window.) It is possible to reattach the filedescriptors to a different file by attaching the program in a debugger (i.e. using ptrace) and making it call open, dup and close. There are a few tools that do this; this is a tricky process, and sometimes they will crash the process instead. The possibilities include (links collected from answers to How can I disown a running process and associate it to a new screen shell? and Can I nohup/screen an already-started process?): grab (and the more ambitious cryopid) neercs reredirect reptyr retty
How can I disown a running process and associate it to a new screen shell?
1,339,090,327,000
I accidentally created over 1000 screens. How do I kill them all with one command? (Or a few)
You can use : pkill screen Or killall screen In OSX the process is called SCREEN in all caps. So, use: pkill SCREEN Or killall SCREEN
How do I kill all screens?
1,339,090,327,000
I've accidentally attached to a 2nd GNU screen session from within an existing screen session and cannot detach or issue commands to the inner screen. I remember figuring out how to do that before but completely forgot and would like to keep it as reference. One way is to detach the inner screen by doing screen -dr from shell, but what is the key combination to do that from within screen itself?
ctrl-a a d
How do you detach the 2nd screen from within another screen?
1,339,090,327,000
When I type screen -r I expect to either see: A list of screens to resume, or a message "There is no screen to be resumed." Today, I see there is one screen, but I still get the message that there is no screen to be resumed: [root@server chiliNUT]# screen -r There is a screen on: 27863.pts-1.server (Attached) There is no screen to be resumed. [root@server chiliNUT]# screen -rx 27863 [detached] [root@server chiliNUT]# screen -r There is a screen on: 27863.pts-1.server (Attached) There is no screen to be resumed. Why is it reporting that the screen is attached? I just detached it on the line above ([detached])
As screen -r says, there is one screen, but it is attached. To resume it on your current terminal, you have to detach it from the other one first: screen -d -r 27863, see manpage -d. Edit: use -d instead of -x. Edit2: @alex78191: When using -x, screen attaches to the currently running session, resulting in a "multi-display mode": you see the session on both terminals simultaneously, i.e., when entering a command on one terminal, it also appears on the second. However, detaching from a multi-display mode just detaches the current terminal. You hence get the message that it is still attached (on the other terminal).
there are screens in the list, but "no screen to be resumed"