[Solved] Why not Pe/StyledEdit from terminal?

Why can’t I start Pe and StyledEdit from terminal?

I’m guessing that you’re not using the full path to the command and the directory isn’t in your $PATH variable?

/boot/system/apps/Pe/Pe [filename]

That works fine for me.

Since apps are each in their own subdirectories, there’s no one directory to add to $PATH.

One solution would be for you to create ~/cmdaliases/, then add symlinks in that directory pointing to any GUI apps you want to use from the Terminal then add that directory to the $PATH variable?

1 Like

Sure you can? If you want to use Pe as a substitute for a commandline editor you can start it as “lpe”

1 Like

Hah; I did not know about that one.

Maybe I think too linuxy and haven’t yet adapted to the Haiku way. But in Linux I type from the terminal for example “kwrite example.txt”. It sucks a bit that I can’t do that in Haiku. (Well, my way is a mix of terminal and GUI using.)

Edit: This solution looks good, will test it:

Hold alt and click the filename or use “open file”, that is the normal way. But you can also use “StyledEdit file” That works fine too.

What error do you get?

That is unusual, and not the rule. The normal case for Haiku is a selfcontained ELF and not a folder

It is not a normal case and and only applicable for simple enough programs. For more complex program such as Pe, Beezer, BePdf etc. separate application directory is used.

1 Like

There is ~/config/non-packaged/bin where you could drop these links, another way is to create alias’s in the file ~/config/settings/profile (works the same as .bashrc(*) on any linux distro).

1 Like

Neat; I did not know about those either. :slight_smile:

For completeness, here’s the default $PATH:

~> echo $PATH
.:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/home/config/apps:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences

1 Like

Personally try to avoid /system/non-packaged myself, but that works too, the “profile” file does need to be in ~/config/settings (over the years that has grown quit a bit here, thanks to some tips from @BiPolar :slight_smile: )

A backup is done for my file (although outdated - should really push my latest changes there) at:

One of the simplest way to start GUI apps from Terminal wasn’t mentioned so far: The open command.
Run open filename to open the file in the default application set for that filetype.
For textfiles,that should usually be StyledEdit,but the open command works with any sort of file.

3 Likes

Thanks to everybody, several good solutions. I think I will go with the solution from @nephele and @nipos:

“open example.txt”