#StackBounty: #terminal #fonts #xorg #unicode #true-type-fonts Different line spacing depending on font encoding

Bounty: 50

Historically, I’ve been using Monotype Courier New as my XTerm font (it displays well both Cyrillic characters and box-drawing characters). When migrating from legacy KOI8-R to UTF-8 locale, I’ve noticed a change in the inter-line spacing (or leading), which made Courier New no longer suitable for terminals.

Here’s how my XTerm used to look in ru_RU.KOI8-R locale (12pt Courier New):

enter image description here

Here’s how it looks now (ru_RU.UTF-8, 12pt again, character width is the same, but note the increased leading, vertical box-drawing charaters form a double “dashed” line):

enter image description here

Apparently, XTerm is not the only application affected. Basically, all programs using Core X11 Fonts exhibit the same behaviour. Take a look at xfontsel displaying different encodings of the same font:

KOI8-R:

enter image description here

ISO 10646-1 (which stands for Unicode):

enter image description here

Interestingly, Courier New seems to be the only monospaced font affected. Other fonts, like -misc-freemono-*, have the same leading regardless of the encoding.

Now, the question:

Is there any way I can enforce the particular leading for a particular font? Should I look into the FreeType library? Or Xft? Any ideas are appreciated.


Get this bounty!!!

#StackBounty: #terminal #external-command #shell #filter Difference between `:!{cmd}` and `:w !{cmd}` regarding alternate screen

Bounty: 100

On a Linux platform I see this difference of behavior between running a shell command with :!{cmd} (which just runs the command directly) and with :w !{cmd} (which passes the buffer as standard input to the command.)

Running :!{cmd} will switch back from the alternate screen back to the main screen, which means the Vim buffer and UI are hidden and the screen on the shell where I ran Vim are presented back, then the command output is printed and the “hit return” prompt is issued.

If I start vim, then run :!echo hello, the result I see is:

$ vim

hello

Press ENTER or type command to continue

That text is also present after I exit Vim, since it’s been output into the main screen, not the alternate screen that Vim is managing.

On the other hand, if I run the same command with :w !{cmd}, Vim simply prints the output of the command below the Ex command-line. For :w !echo hello, what I end up seeing is:

~
~
~
[No Name]                             0,0-1          All
:w !echo hello
hello

Press ENTER or type command to continue

You’ll recognize the ~s as Vim’s empty lines at the end of the buffer, and the [No Name] line as Vim’s status line. The Ex command is also not cleared.

Why the difference?

The documentation isn’t very clear about it. The closest thing mentioned in :help :! is that “Vim redraws the screen after the command is finished, because it may have printed any text”, but that doesn’t really explain why it needs to switch back to the main screen. It also mentions using :silent to prevent redrawing, but that prevents any output altogether.

Documentation in :help :write_c doesn’t help much either, it says *”{cmd} is executed like with :!{cmd}“, but it’s actually referring to how !s are special in the command itself…

Is there a way to make :!{cmd} behave like :w !{cmd}, without switching back from the alternate screen?

Or is there another way to run an external command on the alternate screen, that doesn’t involve passing it lines from the current buffer as standard input?


Get this bounty!!!

#StackBounty: #terminal #external-command #shell Difference between `:!{cmd}` and `:w !{cmd}` regarding alternate screen

Bounty: 100

On a Linux platform I see this difference of behavior between running a shell command with :!{cmd} (which just runs the command directly) and with :w !{cmd} (which passes the buffer as standard input to the command.)

Running :!{cmd} will switch back from the alternate screen back to the main screen, which means the Vim buffer and UI are hidden and the screen on the shell where I ran Vim are presented back, then the command output is printed and the “hit return” prompt is issued.

If I start vim, then run :!echo hello, the result I see is:

$ vim

hello

Press ENTER or type command to continue

That text is also present after I exit Vim, since it’s been output into the main screen, not the alternate screen that Vim is managing.

On the other hand, if I run the same command with :w !{cmd}, Vim simply prints the output of the command below the Ex command-line. For :w !echo hello, what I end up seeing is:

~
~
~
[No Name]                             0,0-1          All
:w !echo hello
hello

Press ENTER or type command to continue

You’ll recognize the ~s as Vim’s empty lines at the end of the buffer, and the [No Name] line as Vim’s status line. The Ex command is also not cleared.

Why the difference?

The documentation isn’t very clear about it. The closest thing mentioned in :help :! is that “Vim redraws the screen after the command is finished, because it may have printed any text”, but that doesn’t really explain why it needs to switch back to the main screen. It also mentions using :silent to prevent redrawing, but that prevents any output altogether.

Documentation in :help :write_c doesn’t help much either, it says *”{cmd} is executed like with :!{cmd}“, but it’s actually referring to how !s are special in the command itself…

Is there a way to make :!{cmd} behave like :w !{cmd}, without switching back from the alternate screen?

Or is there another way to run an external command on the alternate screen, that doesn’t involve passing it lines from the current buffer as standard input?


Get this bounty!!!

#StackBounty: #bash #terminal #rename Moving files from one folder to another based on specific condition

Bounty: 250

I have hundreds of thousands of folders of photos. For whatever reason on the export they created several scenarios like this:

2019/01/01
2019/01/01 #2

How do I write a linux command (ideally which can be run on Mac) which can automatically move the files

from 
2019/01/01 #2 
to 
2019/01/01

Any help would be appreciated. This would need to work for any date and also merge the contents. Where I am struggling is I can’t understand how to get the dir as the original format without the #

for dir in *#2/*; do mv "$dir"/* "${dir}"; done


Get this bounty!!!

#StackBounty: #terminal #openbox #wallpaper #devilspie openbox: window on layer "below" is inacessible

Bounty: 500

I am trying to set up a “terminal as desktop wallpaper” in Openbox, as described here

Openbox has the possibility to set <layer>below</layer>, so that window is running as desktop background, and won’t be displayed by the statusbar and unaffected by “minimize windows”. So instead of displaying a useless image as wallpaper, I actually have a terminal.

The actual terminal that I am running as background is terminator, I have just created a symlink terminator-wallpaper-1a and terminator-wallpaper-1b, which are just symlinks to the terminator binary. Only so that the names are different, and I can distinguish them.

I have dual monitor setup, and I want terminator wallpaper on each monitor.

The openbox window property is set by devilspie:

(if
(matches (application_name) "terminator-wallpaper")
(begin
(wintype "desktop")
)
)

And then, I have this in my openbox config, so that each wallpaper goes to corresponding monitor/desktop:

<application name="terminator-wallpaper-1a">
  <focus>yes</focus>
  <layer>below</layer>
  <desktop>1</desktop>
  <position>
    <y>0</y>
    <x>0</x>
    <monitor>1</monitor>
  </position>
  <skip_taskbar>yes</skip_taskbar>
  <maximized>true</maximized>
</application>

<application name="terminator-wallpaper-1b">
  <focus>yes</focus>
  <layer>below</layer>
  <desktop>1</desktop>
  <position>
    <y>0</y>
    <x>0</x>
    <monitor>2</monitor>
  </position>
  <skip_taskbar>yes</skip_taskbar>
  <maximized>true</maximized>
</application>

Lastly, this is how I start the whole thing:

devilspie &
terminator-wallpaper-1a -b &
terminator-wallpaper-1b -b &

xdotool set_desktop 0

xdotool search --class 'Terminator-wallpaper-1a' windowunmap --sync windowmap windowsize %1 1920 1180
xdotool search --class 'Terminator-wallpaper-1b' windowunmap --sync windowmap windowsize %1 1920 1180

Everything works nicely, and when I minimize all other windows, I actually see my terminator wallpapers. But only one of them is actually usable. ie, focused, or active. The other I cannot type into. Even when I click with the mouse, the cursors is still inactive, so that the window never becomes focused.

How can I fix this ?


Get this bounty!!!

#StackBounty: #macos #npm #terminal #zsh #oh-my-zsh Terminal (zsh) command not found

Bounty: 250

This is driving me nuts! I did a lot of googling and tried various things. (I do not consider this to be a superuser topic)

I’m having a lot of troubles with terminal lately. I must have messed up somewhere, because it used to work just fine and now I can’t get it to recognize my commands anymore neither nvm or global npm packages like expo. It just gives me errors like this:

▶ expo      
zsh: command not found: expo
▶ nvm ls
zsh: command not found: nvm

If I do echo $PATH I get:

/Users/norfeldt/Library/Android/sdk/tools/bin:/Users/norfeldt/Library/Android/sdk/tools:/Users/norfeldt/Library/Android/sdk/platform-tools:/Applications/anaconda/bin:~/Library/Python/2.7/bin:~/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

(strange behavior is that if I do echo $PATH again it returns two times the same output in one line)

A readable version of it (replacing : with :n

/Users/norfeldt/Library/Android/sdk/tools/bin:
/Users/norfeldt/Library/Android/sdk/tools:
/Users/norfeldt/Library/Android/sdk/platform-tools:
/Applications/anaconda/bin:
~/Library/Python/2.7/bin:
~/.npm-global/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin

My .zshrc file looks like this:

# Node & NPM
#PATH="/usr/local/bin:$PATH"
PATH="~/.npm-global/bin:$PATH"
#PATH="~/.npm-global/lib/node_modules:$PATH"

# Git
alias master="git checkout master"
alias dev="git checkout develop"
alias hotfix="git flow hotfix"
alias feature="git flow feature"
alias tags="git push --tags"

# Pip - https://gist.github.com/haircut/14705555d58432a5f01f9188006a04ed
PATH="~/Library/Python/2.7/bin:$PATH"

# added by Anaconda2 4.4.0 installer
PATH="/Applications/anaconda/bin:$PATH"

# Android
export ANDROID_HOME=/Users/norfeldt/Library/Android/sdk
PATH="${ANDROID_HOME}/platform-tools:$PATH"
PATH="${ANDROID_HOME}/tools:$PATH"
PATH="${ANDROID_HOME}/tools/bin:$PATH"

alias emu="pushd ${ANDROID_HOME}/tools;emulator -avd Pixel_2; popd"

# Path to your oh-my-zsh installation.
export ZSH=/Users/norfeldt/.oh-my-zsh

ZSH_THEME="avit"

# Autojump
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh

# shell startup.
plugins=(git)

source $ZSH/oh-my-zsh.sh

# Load zsh-autosuggestions.
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh

# zsh-syntax-highlighting
source /Users/norfeldt/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

export PATH

ANY help would be HIGHLY appreciated!


Get this bounty!!!

#StackBounty: #terminal #thinkpad Pop!_OS terminal invisible input

Bounty: 50

I’ve recently installed Pop!_OS and from the very beginning on (even in liveboot) the text I just typed in the terminal, as well as the output wasn’t visible for a few seconds and then suddenly appeared. This problem vanished after using the terminal for a few minutes and reappeared after restarting the terminal application. This is certainly not a performance issue, as the delay actually is multiple seconds long, in which the terminal is otherwise still fully functional.

I am using a ThinkPad E485, the following is the output of neofetch:

             /////////////                metacolon@pop-os 
         /////////////////////            ---------------- 
      ///////*767////////////////         OS: Pop!_OS 19.04 x86_64 
    //////7676767676*//////////////       Host: 20KUS02700 ThinkPad E485 
   /////76767//7676767//////////////      Kernel: 5.0.0-15-generic 
  /////767676///*76767///////////////     Uptime: 41 mins 
 ///////767676///76767.///7676*///////    Packages: 1856 (dpkg) 
/////////767676//76767///767676////////   Shell: zsh 5.5.1 
//////////76767676767////76767/////////   Resolution: 1920x1080 
///////////76767676//////7676//////////   DE: GNOME 3.32.1 
////////////,7676,///////767///////////   WM: GNOME Shell 
/////////////*7676///////76////////////   WM Theme: Pop 
///////////////7676////////////////////   Theme: Pop [GTK2/3] 
 ///////////////7676///767////////////    Icons: Pop [GTK2/3] 
  //////////////////////'////////////     Terminal: gnome-terminal 
   //////.7676767676767676767,//////      CPU: AMD Ryzen 5 2500U with Radeon Ve 
    /////767676767676767676767/////       GPU: AMD ATI Radeon Vega Series / Rad 
      ///////////////////////////         Memory: 2632MiB / 7658MiB 
         /////////////////////
             /////////////                                        

Note that I’ve recently installed zsh and guake, which didn’t cause the problem to disappear, but also didn’t cause the problem to start, as I never didn’t have the problem in Pop!_OS. Also note that I had to adjust the boot parameters, to be able to install Pop!_OS (and every other Linus distribution for that matter), which might have caused the problem. It also might interest you that the problem does not occur in TTYs. I’m not familiar with that kind of stuff though, so I hope that you can help me.


Edit I realized that the text instantly appears if the terminal window loses focus. This is the main reason I can’t provide a screenshot for this question.


Edit Whilst installing a system update, I got the following warning:

update-initramfs: Generating /boot/initrd.img-5.0.0-15-generic
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
W: Possible missing firmware /lib/firmware/amdgpu/vega20_ta.bin for module amdgpu
kernelstub.Config    : INFO     Looking for configuration...
kernelstub           : INFO     System information: 

    OS:..................Pop!_OS 19.04
    Root partition:....../dev/nvme0n1p3
    Root FS UUID:........df269b39-4b92-4870-8f80-db4d2df9c762
    ESP Path:............/boot/efi
    ESP Partition:......./dev/nvme0n1p1
    ESP Partition #:.....1
    NVRAM entry #:.......-1
    Boot Variable #:.....0000
    Kernel Boot Options:.quiet loglevel=0 systemd.show_status=false splash ivrs_ioapic[32]=00:14.0 ivrs_ioapic[33]=00:00.1
    Kernel Image Path:.../vmlinuz
    Initrd Image Path:.../initrd.img
    Force-overwrite:.....False

I don’t know if it’s relevant, but maybe it helps finding a solution for my problem – which by the way didn’t disappear after installing the update.


Get this bounty!!!

#StackBounty: #linux #ubuntu #terminal #ubuntu-18.04 Ubuntu versions in Login loop, even the terminal window

Bounty: 50

I have tried installing various versions of Ubuntu on Udoo board but each time after installation the operating system ends up in a login loop, even the terminal window launched after the combination of ctrl+alt+f3 is stuck in the loop. I believe that this might seem to be a duplicate question at once but in each scenario for all the users in nearly all the questions at least the terminal seems to work fine for login. Also I have tested the compatibility of the OS with the SBC by installing it on another similar board and everything works fine. I have tried installing Ubuntu 18.04, 16.04, Ubuntu-MATE 18.04 and 16.04 but each time the result seems to be the same. However, things seem to work fine in the guest mode for MATE.


Get this bounty!!!

#StackBounty: #terminal #x11 #awesome #rxvt #compose-key XCompose is not updated for Urxvt when window manager starts

Bounty: 100

I am using awesome WM. When I start my window manager, I run setxkbmap -option compose:menu which has a ~/.XCompose with various extra definitions. Those work fine in Gvim, Firefox, Signal, and Slack (for example) but not in urxvt or anything under urxvt.

I tried using the above command as part of ~/.xprofile, as a run_once(…) command in awesome configuration, restarting all terminal, and nothing changes: the binding are not present in the terminal.

What am I missing here?

PS: Just in case, yes, the terminal has all the correct glyphs…

PS 2: I do not believe this is awesome specific but added in case it makes a difference.


Get this bounty!!!