Posts about shell

'Fish Shell 2.1 messed up prompt'

24 January 2015

If you upgraded to the [Fish Shell](http://fishshell.com) version 2.1 you might have noticed your prompt now containing a bunch of new lines (blank). I believe it's due to the fact that the **echo** command now produces a new line by default (even though that's not explicitly stated in the [release notes](http://fishshell.com/release_notes.html)) [1](#note).

To solve it, replace all ocurrences of echo in your Fish prompt function with **echo -n \**. This will tell echo to not end with a new li...

"Call piped shell commands from Objective-C"

24 January 2015

If you happen to want to know how to run - say - the following command from inside an Objective-C application:

echo "something something" | multimarkdown

So that the fantastic [MultiMarkdown](http://fletcherpenney.net/multimarkdown/) runs its magic and transforms **something something** into **\something something\**, then you need to do as below:

- (NSString*) convertMD:(NSString *)data {

// Task for echo NSTask *echoTask = [[NSTask alloc] init]; [echoTask setLaunchPath: @"/...

FISH Shell - How to set tmux window/pane title based on current command and directory

24 January 2015

Here's a neat trick: Setting the current tmux window/pane title to the current running command. In case there is no command running, show the current working directory. But trim it a little, so we don't end up with huge window titles :)

In your config.fish file add the following functions:

# Set the tmux window title, depending on whether we are running something, or just prompting function fish_title if [ "fish" != $_ ] tmux rename-window "$_ $argv" else ...

Displaying all 3 posts