Displaying Salesforce Test Status in screen using JSforce

by Patrick Connelly posted on September 29, 2014

This post will probably only be useful to one other person out there, but it was a fun exercise and thought I’d at least share my output.

One of the biggest challenges I have when running tests is that I will often forget they are running and leave them completed for a while before I go back and remember I ran them. This mainly happens when I’m running an entire class worth of tests and have 5-10 minutes to kill. When first learned about JSforce and it’s cli capability I was in love! So I set out to make it so that the current testing status is displayed inside of my screen session. At the end of it all this is what I came up with:

Screen status

External programs that update screen

by Patrick Connelly posted on September 18, 2009

Screen is a great tool, and it allows you do to alot of neat things. One of my favorites is binding commands to key strokes. So all you have to do is hit F5 and it will start something in the background. Such as a build command. The problem is, you either get no output, or you get spam all over your screen. Well I’ve finally found a way around that. The answer lies in ANSI Privacy Messages.

Perpetual Screen Part Deux

by Patrick Connelly posted on February 02, 2009

So, I’ve figured out how to add in a “fail-safe” to the perpetual screen, so that if you want to ssh without starting screen you can. And it’s pretty easy. First add the following to your sshd_config and restart ssh


Then add the following to the bottom of you .bashrc: (Note: I named my screen ‘main’ you can name yours whatever you want)

# Hack to get around if the variable is not set

if [ $TERM = "screen" ]
# If we are already in a screen do nothing
     echo -n ""
elif [ $TERM = "dumb" ]
# If we are using scp do nothing
     echo -n ""
elif [ $NO_SCREEN = ".true" ]
# Our fail safe to ssh w/o screen
     echo -n ""
# Startup screen
     screen -Rd main && exit

Then, you can either ssh like normal to start the screen, or do the following to login without screen starting

export NO_SCREEN="true"

ssh -o "SendEnv NO_SCREEN" user@host

Works like a champ.

Perpetual Screen

by Patrick Connelly posted on December 29, 2008

This article has been updated

So, I’ve been tossing around the idea for the past while to make is so that screen starts up every time I ssh into my box at the house. Well, I finally broke down and did it, and it wasn’t that bad at all. I’ve named my screen session main you can call it whatever you want. Just add the following to the end or your .bashrc If you don’t put it at the end, you the rest of your .bashrc won’t get evaluated.