Hot answers tagged

14

Every opened "pseudo-terminal" (or "terminal emulator") have a special file in /dev/pts/ for each of it's windows/tabs and those files/numbers auto-increments, gets freed and are re-used. This simple script is using exactly those numbers to select a color from static configuration table. Append it to your ~/.bashrc: # custom color selector config=( 1 # ...


5

If you really need to get the number of terminal you have open, go for counting the files owned by you under /dev/pts (although this might include ones opened by background processes, not by graphical terminal emulators). Alternatively, count the number of child processes of your terminal emulator(s), as shown by Jacob in the first line of his response. ...


5

In a single user situation, if we take the example of xterm, we can simply count the number of pids of xterm; xterm creates a separate pid for each and every window. gnome-terminal however runs a single pid, but the good news is that it creates a child process for each and every window and/or tab. we can retrieve these child processes by the command: pgrep ...


3

There is no config file. The gnome-terminal manages all its settings through dconf (or gconf in old Ubuntu releases) which is comparable to the Windows registry. It's a binary file optimized for quickly reading its values, you can not edit or view it manually like a text document. If your dconf-editor or whatever tool you're trying to use is not working, ...


2

The cursor move speed is related to your keyboard's repetition rate you can use kbdrate to change it but it will change it globally. sudo kbdrate will give you the current settings Usage: kbdrate [-V] [-s] [-r rate] [-d delay] I'm not really sure on this .. didn't look into it but I found that the delay is the time before the repeating starts and ...


2

The U+2500 .. U+25AF characters are drawn manually by VTE, not taken from the font. And, indeed, the three particular characters you've mentioned are drawn as single solid colors. This is the same as the imaginary result of printing the pattern with the dots being infinitely small (and having an infinite amount of them to achieve the desired density), and ...


2

Based on the way Chrome is designed to be self contained, there likely isn't any way to make an extension to do this. However, most newer Linux users don't seem to know that if you highlight text with your mouse, you can middle-click and paste it anywhere else. So you can just highlight the text in the browser and middle-click it into your terminal.


2

If you started some process in terminal (eg. gedit) than the Process ID (PID) (of bash) and Parent Process ID (PPID) (of gedit) will be the same for this two processes will be the same. This can be seen in the output of ps -ef command. To make it more readable lets first "pipe" the output to grep to find the PID of all "bash" processes and than take only ...


2

In bash's primary prompt ($PS1) all non-printable characters (e.g. escape sequences that change the color) have to be enclosed between literal \[ and \]. Similarly, for all other readline-based apps, such as gdb, non-printable characters in the prompt need to be enclosed between a 0x01 and a 0x02 byte. You can refer to these in .gdbinit as \001 and \002.


2

Fixed by setting Hinting to Slight in Gnome Tweak Tool.


2

The option to set the terminal title has been deprecated in 16.04 LTS, however there is still a way to set the title. Edit your ~/.bashrc file and add the following lines: # function to set terminal title function set-title(){ if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$*\a\]" PS1=${ORIG}${TITLE} } After that close and reopen the ...


1

An awk way: who | awk 'BEGIN{count=0}{ if(NR!=1){count++} }END{print count}' Explanation: In above 1 liner command, awk is used to find the count of terminal. Inside awk program, it is just checking the number of lines return by who command - 1.


1

You can edit ~/.bashrc and apply the change yourself. Open up ~/.bashrc and look for the following line: #force_color_prompt=yes Remove the # from the beginning of the line and save. You will have to source the file for the change to apply. If you reboot everything should work. If you want to change the colour as well, see this: Changing colors for ...


1

How to make a new terminal window, initiated by Ctrl+Alt+T open on the currently active screen? Although Very much related to this one, not a dupe, and it requires a completely different solution. Your question is specific to gnome-terminal, and you are using a shortcut to start the application. These two make a background script unnecessary, and ask for ...


1

Such file: #!/usr/bin/env python3 x = 50 def func_outer(): x=2 print('x is '), x def func_inner(): nonlocal x x=5 func_inner() print('the local x changed to '),x when run as ./file.py yields no errors with python3.5 on Ubuntu 16.04.


1

PDF is not a normal text file. You shouldn't cat it anyways. There are programs for reading a PDF.


1

Entering reset should fix it again.


1

You can use command line options to launch the terminal window with desired settings. In codeblocks : Go to Settings > Environment > General Settings. Change the "Terminal to launch console programs" option to : gnome-terminal --geometry=WIDTHxHEIGHT+XOFF+YOFF -x +XOFF : The left edge of the window is to be placed XOFF pixels in from the left ...


1

I needed to work out what DHCP server I was connected to via Ubuntu 14.04 so I used this command: nmcli dev list|grep DHCP4 as this is what I wanted only from the original command "nmcli dev list" DHCP4.OPTION[1]: expiry = 1464073312 DHCP4.OPTION[2]: domain_name = [omitted_proper_details] DHCP4.OPTION[3]: broadcast_address = 10.1.45.255 ...



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