WP-Terminal

December 6th, 2009 Leave a comment Go to comments

WP-Terminal is a Wordpress Plugin that provides a terminal-like box for embedding terminal commands within pages or posts.

Here, you can see a live demo of the plugin:

mariano@computer:$ ls -a
user@vera:$ ls -a
mariano@vera:$ ls -a
user@computer:$ ls -a
user@computer:$ ls
. ..

ls -a
. .. .hiden_file

Take a look to the Wordpress page of the plugin to see the basic syntax and download links

This plugin is just a customization of Ryan McGeary’s WP-Syntax, and the css is an idea taken from a nice blog: Casidiablo

Blogs using WP-Terminal:

If you want to be added to this page, just leave a comment and provide your URL

Compartí:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Netvibes
  • StumbleUpon
  • Technorati
  • Twitter
  1. April 24th, 2009 at 01:16 | #1

    Hola!, he visto por ahi que hablas español, espero que asi sea :-P , el plugin esta excelentisimo!!, gracias por ese gran aporte!

  2. May 21st, 2009 at 06:26 | #2

    Hi I’ve been looking for something like this nice plugin for some time being a *nix geek it’s wonderful to have the terminal icon displayed for commands/code snippets so if you want feel free to add my blot to the list of sites using your plugin :D

    Thanks, Lethe.

  3. July 17th, 2009 at 07:56 | #3

    Excellent plug in! Thank you very much for making it!

    I have a feature request. Could you make the default username and computer globally configurable in a settings section on the WordPress configuration, so that I don’t have to put them everywhere except where I want a different one and still have a nice username and computer on my web site.

    • July 17th, 2009 at 12:48 | #4

      Hi Pablo! Glad you liked it.

      Even it’s in my plans to add a config page, I don’t know when I’ll be able to do it. In the meanwhile, you can edit wp-terminal.php and modify the defaults in lines 85 and 87 as a workaround ;)

  4. July 17th, 2009 at 12:41 | #5

    The documentation says that we should add an id=”terminal” to each pre, but ids should be unique so you either end up with only one terminal per post, or with broken HTML. It should be class, not id, for the argument.

  5. July 17th, 2009 at 12:46 | #6

    @J. Pablo Fernández
    Nevermind, disregard that comment.

  6. July 26th, 2009 at 09:51 | #7

    Add change prompt from user root:

    if ($user == ‘root’) {
    $prompt = $user.”@”.$computer.”:# “;
    } else {
    $prompt = $user.”@”.$computer.”:$ “;
    }

  7. July 26th, 2009 at 15:13 | #8

    Hello again,

    I made some more changes to its plugin and packaged it in http://rra.etc.br/linux/wp/wp-terminal.0.3.zip

    The changes were:

    - Added the option “color” to color the prompt (like gentoo-linux prompt). The possible values are “true/false”, with the default “false”;

    - Now the plugin replaces the occurrence of the key [prompt] for the $prompt;

    - Put the $prompt string in bold to highlight.

    - Remove blank lines from the beginning and end of

     block. This allows you to create code as:
    
    ls-la
    total 788
    drwxr-xr-x 3 rudson users 4096 2009-07-26 14:55. /
    drwxr-xr-x 4 rudson users 48 2009-07-24 14:35 .. /
    -rw-r - r - 1 rudson users 207679 2009-07-24 11:56 category-icons.2.1.zip
    

    but not put blank lines at the beginning or end of the block of commands.

    These changes were made by my friend Almir Mendes (m3nd3s@gmail.com) and other minor changes by me (rudsonalves@rra.etc.br).

  8. December 1st, 2009 at 18:24 | #9

    @rudson
    I’ve been using wp-terminal for a while, but I just replaced the wp-terminal.php from rudson’s modifications and the [prompt] replacement was one of the things I really wanted in the plugin :)
    the ‘color’ option needs some work though. I might add some updates of my own to this plugin soon

  9. December 2nd, 2009 at 03:27 | #10

    I have started to use it on my blog to, Nice Work.

  10. December 6th, 2009 at 13:09 | #11

    nice plugin! good for Linuxers.

  1. May 13th, 2009 at 13:50 | #1