ProzillaOS/docs/features/applications/terminal
2023-08-15 18:55:43 +02:00
..
README.md Updated docs 2023-08-15 18:55:43 +02:00

← Back

Terminal ("Commands")

A command line tool.

Commands

See features/applications/terminal/commands.js for a list of commands. You can edit this file to add/remove/edit commands.

Examples

// features/applications/terminal/commands.js

new Command("cd", (args, { currentDirectory, setCurrentDirectory }) => {
	const path = args[0] ?? "~"; // Default to home directory
	const destination = currentDirectory.navigate(path);

	if (!destination)
		return `cd: ${args[0]}: No such file or directory`;

	setCurrentDirectory(destination);
	return { blank: true }; // Returns without printing anything to the terminal
}),