You are not logged in.

#1 2016-04-05 16:23:15

blutechgirl
Member
Registered: 2015-05-27
Posts: 43

[SOLVED]how to change the error message in fish shell

the default is unknown command but i would like to see if instead it would run a custom command
whenever i enter invalid input

Last edited by blutechgirl (2016-04-06 00:30:23)

Offline

#2 2016-04-05 19:21:27

onslow77
Member
Registered: 2014-09-21
Posts: 283

Re: [SOLVED]how to change the error message in fish shell

Hello!

If it is possible, the description is in the Arch Wiki (Fish Page) or it is in here (The Fish Manual).

Regards
Martin

Last edited by onslow77 (2016-04-05 19:21:39)

Offline

#3 2016-04-05 19:23:29

blutechgirl
Member
Registered: 2015-05-27
Posts: 43

Re: [SOLVED]how to change the error message in fish shell

i already looked there, but i didn't find anything relevant

Offline

#4 2016-04-05 19:48:01

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,408
Website

Re: [SOLVED]how to change the error message in fish shell

This is where it's defined: https://github.com/fish-shell/fish-shel … .fish#L176

There's even a conditional for pkgfile, a utility on Arch that can search for packages that provide the missing command.

If that's not what you're looking for, perhaps you can override the built in handler. I don't use fish, so I don't know if that's possible or not.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2016-04-06 00:30:00

blutechgirl
Member
Registered: 2015-05-27
Posts: 43

Re: [SOLVED]how to change the error message in fish shell

thanks that helped me figure it out
I replaced:

if test -f /etc/SuSE-release; and type -q -p command-not-found
			function __fish_command_not_found_handler --on-event fish_command_not_found
				/usr/bin/command-not-found $argv[1]
			end

with

if test -f /etc/arch-release
			function __fish_command_not_found_handler --on-event fish_command_not_found
				/usr/bin/betty $argv[1]
			end

i used the command betty to call the betty digital assistant so when ever i type something like:

download http://www.mysite.com/something.tar.gz to something.tar.gz

or

find me all files that contain california

in my terminal it would give me something useful without having to prefix every command with betty

EDIT: I had to install fish-git for this to work

Last edited by blutechgirl (2016-04-08 18:41:55)

Offline

Board footer

Powered by FluxBB