Terminal cd command has 0.5 second delay

Simple problem. My cd commands are running slow on all terminal clients. The "cd" command has a 0.5s delay before it completes. It happened over night. I dont know why.

My bashrc:
#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\[email protected]\h \W]\$ '


fish


----------------
My alacritty  (Terminal app)config:
key_bindings:
  - { key: V, mods: Control, action: Paste }
  - { key: C, mods: Control, action: Copy }
  - { key: Q, mods: Control, action: Quit }
  - { key: W, mods: Command, action: Quit }
  - { key: Home, chars: "\eOH", mode: AppCursor }
  - { key: Home, chars: "\e[H", mode: ~AppCursor }
  - { key: End, chars: "\eOF", mode: AppCursor }
  - { key: End, chars: "\e[F", mode: ~AppCursor }
  - { key: Key0, mods: Command, action: ResetFontSize }
  - { key: Equals, mods: Command, action: IncreaseFontSize }
  - { key: Minus, mods: Command, action: DecreaseFontSize }
  - { key: PageUp, mods: Shift, chars: "\e[5;2~" }
  - { key: PageUp, mods: Control, chars: "\e[5;5~" }
  - { key: PageUp, chars: "\e[5~" }
  - { key: PageDown, mods: Shift, chars: "\e[6;2~" }
  # How do I set a key binding for Alacritty to interpret `alt+l` on macOS


window:
  opacity: 0.85
colors:
  name: Tomorrow (dark)
  author: Chris Kempson
  primary:
    background: "#16181a"
    foreground: "#c5c8c6"
  cursor:
    text: "#1d1f21"
    cursor: "#c5c8c6"
  normal:
    black: "#1d1f21"
    red: "#cc6666"
    green: "#b5bd68"
    yellow: "#f0c674"
    blue: "#81a2be"
    magenta: "#b294bb"
    cyan: "#8abeb7"
    white: "#c5c8c6"
  bright:
    black: "#969896"
    red: "#cc6666"
    green: "#b5bd68"
    yellow: "#f0c674"
    blue: "#81a2be"
    magenta: "#b294bb"
    cyan: "#8abeb7"
    white: "#ffffff"
theme: Tomorrow.dark




--------------------
My fish config:
if status is-interactive


    # Commands to run in interactive sessions can go here
end



# Define alias in shell

# Define alias in config file ( `~/.config/fish/config.fish` )

# This is equivalent to entering the following function:
function rmi
    rm -i $argv
end

# Then, to save it across terminal sessions:
funcsave rmi


#### >>>> ALIAS <<<< #####
alias jv="java"
alias ja="java"
alias pi="sudo pacman -S"
alias pu="sudo pacman -Syu"
alias hs="history"
alias prez="kquitapp5 plasmashell"
alias lamp="sudo /opt/lampp/lampp start"
alias pr="python"
alias py="python"
alias yi="yay -S"
alias rb="reboot"
alias yu="yay -Syyu"
alias cat="ccat"

#### NAV ####
alias ff="fg"
alias rr="ranger"
alias hd="cd /home/aegir/"
alias c="cd"
alias .="cd .."
alias ..="cd ../../"


alias v="nvim"
alias sv="nvim"




mcfly init fish | source





clear





System:
  Kernel: 6.1.5-zen2-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=bd716b39-6313-4def-bb78-fea6f3782898 rw [email protected]
    quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    loglevel=3 ibt=off
  Desktop: KDE Plasma v: 5.26.5 tk: Qt v: 5.15.8 info: latte-dock
    wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B450M-A v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 3604
    date: 02/25/2022
CPU:
  Info: model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ gen: 2
    level: v3 note: check built: 2018-21 process: GF 12nm family: 0x17 (23)
    model-id: 8 stepping: 2 microcode: 0x800820D
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 768 KiB desc: d-8x32 KiB; i-8x64 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 16 MiB desc: 2x8 MiB
  Speed (MHz): avg: 2306 high: 3700 min/max: 2200/3700 boost: disabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 2200 2: 2200
    3: 2200 4: 2200 5: 3700 6: 2200 7: 2200 8: 2200 9: 2722 10: 1879 11: 2200
    12: 2200 13: 2200 14: 2200 15: 2200 16: 2200 bogomips: 118399
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] vendor: Micro-Star MSI
    driver: nvidia v: 525.78.01 alternate: nouveau,nvidia_drm non-free: 525.xx+
    status: current (as of 2022-12) arch: Pascal code: GP10x
    process: TSMC 16nm built: 2016-21 pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 09:00.0 chip-ID: 10de:1c03 class-ID: 0300
  Device-2: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo
    bus-ID: 1-8:4 chip-ID: 046d:0825 class-ID: 0102 serial: <filter>
  Display: x11 server: X.Org v: 21.1.6 with: Xwayland v: 22.1.7
    compositor: kwin_x11 driver: N/A display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1200 s-dpi: 93 s-size: 1049x321mm (41.30x12.64")
    s-diag: 1097mm (43.19")
  Monitor-1: DVI-D-0 pos: primary,right res: 1920x1200 hz: 60 dpi: 94
    size: 518x324mm (20.39x12.76") diag: 611mm (24.05") modes: N/A
  Monitor-2: HDMI-0 pos: left res: 1920x1200 hz: 60 dpi: 94
    size: 518x324mm (20.39x12.76") diag: 611mm (24.05") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 525.78.01 renderer: NVIDIA GeForce GTX 1060
    6GB/PCIe/SSE2 direct render: Yes
Audio:
  Device-1: NVIDIA GP106 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel bus-ID: 1-8:4 v: kernel chip-ID: 046d:0825 pcie:
    gen: 3 class-ID: 0102 speed: 8 GT/s serial: <filter> lanes: 16
    bus-ID: 09:00.1 chip-ID: 10de:10f1 class-ID: 0403
  Device-2: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 0b:00.3
    chip-ID: 1022:1457 class-ID: 0403
  Device-3: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo
  Device-4: C-Media CM6631A Audio Processor type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 3-3:3 chip-ID: 0d8c:0004
    class-ID: 0300
  Sound API: ALSA v: k6.1.5-zen2-1-zen running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.64 running: yes
Network:
  Device-1: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 07:00.0
    chip-ID: 168c:002b class-ID: 0280
  IF: wlp7s0 state: down mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK PRIME B450M-A driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 08:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp8s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: USB
    driver: btusb v: 0.8 bus-ID: 1-2:3 chip-ID: 0a12:0001 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:
  Local Storage: total: 2.62 TiB used: 48.84 GiB (1.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Silicon Power
    model: SPCC M.2 PCIe SSD size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: H211011a temp: 41.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Crucial model: M4-CT128M4SSD2
    size: 119.24 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 000F scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WD20EARX-00PASB0 size: 1.82 TiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s type: N/A serial: <filter> rev: AB51
    scheme: MBR
  ID-4: /dev/sdc maj-min: 8:32 vendor: Kingston model: SUV400S37240G
    size: 223.57 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 96R9 scheme: GPT
Partition:
  ID-1: / raw-size: 243.65 GiB size: 243.65 GiB (100.00%)
    used: 48.81 GiB (20.0%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 28.1 MiB (9.4%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 243.65 GiB size: 243.65 GiB (100.00%)
    used: 48.81 GiB (20.0%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
  ID-4: /var/log raw-size: 243.65 GiB size: 243.65 GiB (100.00%)
    used: 48.81 GiB (20.0%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
  ID-5: /var/tmp raw-size: 243.65 GiB size: 243.65 GiB (100.00%)
    used: 48.81 GiB (20.0%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 7.81 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p5 maj-min: 259:5
  ID-2: swap-2 type: zram size: 15.53 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 43.0 C mobo: N/A gpu: nvidia temp: 29 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
  Processes: 340 Uptime: 54m wakeups: 0 Memory: 15.53 GiB used: 4 GiB (25.7%)
  Init: systemd v: 252 default: graphical tool: systemctl Compilers:
  gcc: 12.2.0 Packages: pm: pacman pkgs: 1387 libs: 340 tools: octopi,paru,yay
  pm: rpm pkgs: 0 Shell: fish v: 3.5.1 default: Bash v: 5.1.16
  running-in: alacritty inxi: 3.3.24
Garuda (2.6.14-1):
  System install date:     2023-01-05
  Last full system update: 2023-01-15
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager mkinitcpio nvidia-dkms
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:

Post always your terminal in- and output as text like
~~~
garuda-inxi
System:
Kernel: 5.18.15-zen1-2-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.1
parameters:
~~~

looks like

garuda-inxi
System:
  Kernel: 5.18.15-zen1-2-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.1
    parameters:

in forum. Please, edit :slight_smile:

3 Likes

Ok. I ll fix it.

3 Likes

Does this happen ONLY with the cd command? And NO other?

It seems to be so. All other commands seem to be instant. ls gives me the results in like 0.05 sec but cd is almost 1s.. which is kind of annoying.

If I had to guess it is somekind of config file messed up but not sure what/where.

I'm thinking about the same thing.
In order to get more info, are you able to boot from USB ISO with latest Garuda ISO and test the cd command from the Live ISO (without installing Garuda)?

This would give a benchmark or something. I mean if you get the same delay from Live ISO, then it's really not a config file on your installation.

2 Likes

Good idea. I am going to DL the latest iso and try it.

1 Like

Test if the issue coincides with accessing a particular drive.

3 Likes

I did a live CD with Garuda. Everything worked fast. cd command was instant.

@BluishHumility This did not help. I think there is some mistake in my "custom" terminal / fish or a related terminal app config. I should maybe reset some configs and see where this takes me. Cant afford the time now so I will work it out later this week.

Btw, it is just a simple button in Garuda assistant to reset the configs.
Just letting you know.

7 Likes

Don't forget to take some backups first!

2 Likes

Actually I have a new question now.

Is there a way to run any app in somekind of "diagnostic" "monitored" mode or get some logs on where the hold up is.

I know that the Linux filesystem is full of inormation being written into files.. I need to figure out where I can get more info.

(I Did clean up some typos with uneven quotes but this was not the issue for now.)

New help request = New topic/thread

Please :slight_smile:

Do not forget to mark the solution.

1 Like

I have found the source of the problem. It is the .config/fish/config.fish file. When I erased the content my fish terminal started moving fast.

I need to build it from the ground up to make sure there are no "glitches" in the config file. <-- Thats incorrect.

What fixed the issue for me was the following:

  1. Copy my config.fish ( fish terminal config file) to a safe location.

  2. Delete ~/.config/fish/ (whole folder) with rm -Rf command.

  3. Run terminal app again run fish again. This seems to fix it.

Now I need to figure out what lines in my config messed up the fish terminal cd command. It might make the config simpler for starters and just build it up piece by piece.

  1. How I fixed the config file? I deleted everything from config.fish file and only left aliases there and everything works. Even the mcfly works (scrollable history) .

I am quite happy now. :smile:


Update on this. I think the problem was caused by McFly misbehaving, I have since uninstalled it.

1 Like

Superb, we are happy if you are! :smiley:

Can you mark a post as the Solution of your thread?
So other people searching for the same issue will immediately know it has been solved in this thread.

1 Like

The β€œstandard” config works here fine, so, did you change something?

On top, you wrote, the cd command has a delay.

Both work smooth here. :smiley:

1 Like

There is more in this directory than just config.fish. Your configuration issue could have come from any number of places.

 exa -aT .config/fish
.config/fish
β”œβ”€β”€ completions
β”œβ”€β”€ conf.d
β”‚  β”œβ”€β”€ done.fish
β”‚  └── mcfly.fish
β”œβ”€β”€ config.fish
β”œβ”€β”€ fish_variables
└── functions
   └── br.fish 

Hopefully you don't need any of that stuff you deleted. :man_shrugging:

3 Likes

This will be part of fish 3.6 natively and much better! :slight_smile:

7 Likes

this is good.
the idea of having some time-traveling nerd keep a record of my terminal inputs is somewhat disconcerting >.>

Well. I deleted all of it.. but backed up the config.fish file. Then I went ahead and just manually copied parts of my old config.fish to the config.fish.

Deleting the fish folder was me "starting at a blank slate" with fish. I found it easier than going over everything one by one. Rebuilding from the ground up seemed easy and it's like 10 + lines of scripting not 100s of lines luckily.:grinning:

1 Like