24 May 2022 |
merlinox | what does this mean ? Oo | 12:47:20 |
merlinox | * Hello there ! I'm using an alias to launch a lutris game
alias sc="lutris lutris:rungame/starcraft-ii&"
This produces this message (and still launches)
- (line 1): The expanded command was empty.
function sc --wraps 'lutris lutris:rungame/starcraft-ii&' --description 'alias sc=lutris lutris:rungame/starcraft-ii&'; lutris lutris:rungame/starcraft-ii& $argv; end ^ in function 'sc'
| 12:50:23 |
faho (Fabian Homborg) | @merlinox:matrix.org alias is a cheesy compatibility function that creates functions. | 13:02:42 |
faho (Fabian Homborg) | In your case, that & means you want your command backgrounded, but alias doesn't know that, and it appends $argv to your command, so it looks like lutris lutris:rungame/starcraft-ii& $argv
That & will terminate the command, so this is effectively lutris lutris:rungame/starcraft-ii &
$argv
which tries to run the arguments you give to the function as a command - and since you gave no arguments, that's empty. | 13:03:58 |
faho (Fabian Homborg) | Tbh what you want is to just make a function: function sc
lutris lutris:rungame/starcraft-ii &
end
or an abbreviation: abbr sc 'lutris lutris:rungame/starcraft-ii &'
This will turn a typed sc into lutris lutris:rungame/starcraft-ii & inside the commandline before it executes. | 13:05:12 |
faho (Fabian Homborg) | (alias is supremely cheesy and overused and imho including it was a mistake, but it is what it is) | 13:05:34 |
merlinox | Aaah, right. Thank you for the explanation :) | 13:11:11 |
merlinox | I knew in the back of my head that aliases in my rc file weren't good with fish | 13:11:31 |
merlinox | but it worked | 13:11:33 |
merlinox | and I have a lot of aliases so I stuck with them. | 13:11:41 |
merlinox | I should be able to replace everything with abbr without problem, right ? | 13:11:52 |
merlinox | Redacted or Malformed Event | 13:12:24 |
merlinox | * do you think it will work with this syntax aswell ?
abbr sc="lutris lutris:rungame/etc" ?
| 13:12:27 |
merlinox | * do you think it will work with this syntax aswell ?
abbr sc="lutris lutris:rungame/etc"
?
| 13:12:38 |
faho (Fabian Homborg) | Basically, yeah | 13:15:29 |
merlinox | %s/alias/abbr/g
%s/="/"/g | 13:17:45 |
merlinox | 😬 | 13:17:50 |
merlinox | whoaaaa, it replaces the abbr immediately ! That's awesome. I should have done this wayyyy sooner | 13:25:59 |
merlinox | I can't wrap my head around why not everybody uses fish :( | 13:26:13 |
| merlinox set a profile picture. | 14:03:26 |
| merlinox changed their profile picture. | 14:03:35 |
ShalokShalom (ShalokShalom) | Hi there | 14:45:52 |
ShalokShalom (ShalokShalom) | I can run fish scripts, who are not part of the auto-loaded fish-prompt, yeah? | 14:46:28 |
ShalokShalom (ShalokShalom) | Since I just saved a file as name.fish and ran it with fish name.fish and it seems to not working. | 14:46:52 |
ShalokShalom (ShalokShalom) | https://ibb.co/FsnBgns | 14:49:29 |
ShalokShalom (ShalokShalom) | see the command line on the bottom | 14:49:51 |
psYchotic | ShalokShalom (ShalokShalom): Add a cosmos line at the bottom of your cosmos-update.fish file, and it should work. That, or remove the function declaration altogether:
function cosmos
kdialog --title "Garuda update" --yesno "There are new updates available. Do you like to install them now?"
sudo pacman -Syu --downloadonly
end
cosmos
or
kdialog --title "Garuda update" --yesno "There are new updates available. Do you like to install them now?"
sudo pacman -Syu --downloadonly
| 14:54:02 |
psYchotic | I suspect by "auto-loaded fish-prompt" you meant "autoloading functions" (https://fishshell.com/docs/current/language.html#autoloading-functions), is that right? | 14:55:47 |
happyeggchen (tsingkwai) | Um could anyone tell me how do i capture ctrl+c in fish shell? | 15:11:19 |
happyeggchen (tsingkwai) | I tried trap and that didn't work | 15:11:29 |