Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist shell adapter history between invocations of hubot #800

Merged
merged 26 commits into from
Dec 5, 2014

Conversation

technicalpickles
Copy link
Member

The shell adapter already uses readline, so it gets some text editing niceties, including a history. It doesn't seem to save or load the history though between hubot runs, which can be super annoying when iterating in development. This PR tries to fix that.

  • includes readline-history
    • it's WTFPL, which is super permissive
    • code doesn't seem to be on GitHub, just npm?
  • saves history to $(pwd)/.hubot_history
  • default to 1024 history items, configurable by HUBOT_SHELL_HISTSIZE
  • preserve position of prompt, so you always get a new prompt after messages are sent (useful for async)

The filename and environment variable are inspired by bash.

Probably should update doc/adapters/shell.md before merging this too.

@technicalpickles
Copy link
Member Author

Also worth noting I used npm install --save readline-history to install it, so that is why there's extraneous diffs in package.json

@technicalpickles
Copy link
Member Author

Added this to the list of improvements:

preserve position of prompt, so you always get a new prompt after messages are sent (useful for async)

bouzuya and others added 22 commits December 5, 2014 16:22
setupExpress() assigns @pingIntervalId but then it is being reset to null
right after.
Sometimes when copying and pasting hubot commands, one might unintentionally
introduce whitespace before the Hubot's name. This commit allows the robot
to respond even if the name is prefixed by an arbitrary amount of whitespace.
converted lingering reference to bender to myhubot
Also changes the type of the user.id property, this should be an integer to match campfire.
technicalpickles added a commit to hubotio/generator-hubot that referenced this pull request Dec 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants