## Kaleidoscope Command Line Tool

The Kaleidoscope ksdiff command line tool serves two main purposes:

1. It acts as the driving force behind many other integrations, in particular with source control systems like git.
2. It can be used directly to compare and merge any number of files

### Installation

To install or remove, follow these instructions:

!

### Update Available

Install the latest version to ensure a properly working setup.

1
Install the ksdiff command line tool Update the ksdiff command line tool The ksdiff tool is installed via a link in /usr/local/bin

#### Manual Installation

The automatic installation above requires an admin account. If you are not administrator of your Mac, but still want to use ksdiff, follow these steps for manual configuration. Show more…

The idea if to add (a link to) `ksdiff` to your `PATH`, so you can just enter `ksdiff` instead of typing the full path. The steps assume you are using the default macOS `zsh` shell. Otherwise adjust commands as needed.

1

Open Terminal (or similar). Terminal is located in /Applications/Utilities

2

Locate ksdiff (inside of Kaleidoscope) using Terminal. On typical macOS installations, apps are located in /Applications. In that case, you could locate it by:

cd /Applications/Kaleidoscope.app/Contents/MacOS
ls -l

The listing should show two entries, `Kaleidoscope` and `ksdiff`.

3

Open the .zshrc file with an editor, e.g. TextEdit.

open ~/.zshrc -a TextEdit
4

Now we expand the PATH variably by including the path to Kaleidoscope. Scroll to the end of the file and insert a new line. Paste the following line, assuming Kaleidoscope is in the default location. Otherwise use the location you found in step 2 above.

PATH="${PATH}:/Applications/Kaleidoscope.app/Contents/MacOS"
5

Quit TextEdit, confirm saving the changes.

6

Quit your Terminal app and start it again. The following command should now show the help for `ksdiff`:

ksdiff --help

### Usage Examples

Compare the text content two draft plain text documents with the final Word document:

ksdiff ~/Documents/Draft1.txt ~/Documents/Draft2.txt ~/Desktop/Final.doc

Merge conflicting changes between Draft1.txt and Draft2.txt into Merge.txt:

ksdiff --merge --output ~/Documents/Merge.txt ~/Documents/Draft1.txt ~/Documents/Draft2.txt

Pipe content into ksdiff using -. This command will compare an original LoremIpsum.txt file with one where all u characters have been replaced with v.

cat LoremIpsum.txt | sed "s/u/v/g" | ksdiff LoremIpsum.txt -

Process Substitution can help comparing the output of multiple other calls. The following sample will compare the output of sorting file1 with the output of sorting file2, without the need to store the sorted files somewhere.

ksdiff <(sort file1) <(sort file2)

Repeatedly send content into the same Kaleidoscope window using the -l option (and piping). The following command will show processes that consume at least 1% of CPU. Use multiple times to compare over time.

ps -crx -o%cpu,command | grep -e "^\s.[1-9]" | ksdiff -l "ps"

## Kaleidoscope Prism App

Kaleidoscope Prism is a small helper living in the top right area of your menu bar by default. It offers several new ways to quickly send content to Kaleidoscope, like a small floating window acting as a drop target as well as configurable global keyboard shortcuts and menu entries to send clipboard contents to Kaleidoscope.

### Installation

As Kaleidoscope Prism is contained in Kaleidoscope, no special installation is necessary. Use the Kaleidoscope General Settings to configure when Prism should be started. By default, it will be started along with Kaleidoscope and then remain running until explicitly quit.

The two other options are 1) to only start Kaleidoscope Prism manually, or 2) to start it automatically when logging in to your computer.

### Features

#### Configurable menu bar icon

Use the menu from the menu bar icon to access all other features and settings of Kaleidoscope Prism. The Settings also allow you to configure the menu bar icon to toggle the window, instead of showing the menu. Also note that you can even drop files directly onto the menu bar icon to send them to Kaleidoscope.

#### Configurable floating window

Select Show Kaleidoscope Prism from the menu to make the window appear. Once visible, you can drop files or text onto it to immediately open the content in Kaleidoscope. The button in the top right of the window also shows the menu, in case you have chosen to not show the menu bar icon in Settings, or to use it to toggle the window.

The Kaleidoscope Prism Settings also allow to toggle the window via global keyboard shortcut, or even have it show automatically when dragging files.

#### Convenient menu entries

Note that the menu entries Send Clipboard to New Comparison, Send Clipboard to Front Document, and Send Clipboard to New Changeset can be augmented with global keyboard shortcuts in Kaleidoscope Prism Settings. Using these menu entries with a keyboard shortcut is a very quick way to send lots of content to Kaleidoscope.

## Services – Access Kaleidoscope from anywhere

Services is one of the most underrated features of macOS. It provides a unified way to send content from one app to another.

The services provided by Kaleidoscope allow sending anything that can be made into text, images or files to Kaleidoscope for comparing.

### Installation

Kaleidoscope provides its services automatically to the system, so there is no need to install anything.

### Configure in System Settings

To enable/disable and configure services to your needs, open System Settings.

1
Open System Settings > Keyboard
2
On the right side, find and click the button Keyboard Shortcuts…, then select Services from the list on the left.
3
The list on the right side shows all services available on your Mac, grouped by categories. You'll find the following services offered by Kaleidoscope:

- Files and Folders: Compare in Kaleidoscope
- Pictures: Compare in Kaleidoscope
- Text: Compare in Kaleidoscope, Open Changeset in Kaleidoscope

Each row allows you to enable/disable that service on the whole system using the checkbox left of the title, and to set a keyboard shortcut by double-clicking the gray none text, or the existing keyboard shortcut if one is already assigned.

### Service Functionality

All apps supporting services have a submenu titled Services in the application menu.

For example, select two text or image files in Finder, head to the Finder menu, select Services, and in the submenu find Compare in Kaleidoscope inside the Files and Folders category. Kaleidoscope opens and shows the comparison of those two files. Note that there was no need to drag and drop or use the clipboard to copy and paste.

Many apps also include a Services entry in contextual menus, to make services directly accessible from where you work, without the need to travel to the application menu.

## Share Extension – Use in Finder and many other apps

Share Extensions are a useful way to export content from one app to another.

Many apps allow sending Text and Image content to Kaleidoscope via a Share menu.

Compare the content of web pages from Safari, text from a Note or different versions of a document from Pages. Or compare different edits of a photo from Photos. The only limit is your creativity.

### Installation

Kaleidoscope offers its Share Extension automatically to the system, there's no need to install anything.

### Enable in System Settings

Before using, Share Extensions needs to be enabled in System Settings.

1
Open System Settings > General > Login Items & Extensions
2
In the list, scroll down to find the Extensions Section.
3
Click the small info button (i) on the right side of Sharing.
4
Find the entry Kaleidoscope and ensure the switch on the right side is turned on.

### Share Functionality

Apps have different ways to plug into the Share functionality and share different kinds of content. Anything that will be shared as text, image or file can be compared using Kaleidoscope.

Take a look at Safari as an example: Open any web page in Safari, then click the Share icon in the toolbar and select Kaleidoscope from the menu.

Now you see the whole text of that web page in Kaleidoscope. If you repeat the process for another web page, you can compare the text content of those pages

You can even select just a part of a page to share with Kaleidoscope. This can be very useful when trying to compare paragraphs of articles on different websites or compare text from a Word/Pages document with what was published on a website.

## Shortcuts – Automation for macOS

Kaleidoscope contains actions for Shortcuts.

These actions allow you to fully automate sending text or image files, text, or files as folder comparison to Kaleidoscope as a part of a larger workflow that can be triggered in various ways.

### Installation

Kaleidoscope offers its actions automatically to Shortcuts, there's no need to install anything.

### Compare Quick Action Example

This example of a Finder Quick Action allows comparing files from the contextual menu or by pressing a button.

Follow these steps to get it installed and show its usefulness:

1
Open the shortcut in the Shortcuts app.
2
In the window that appears, click Add Shortcut.
3
Now we need to ensure the shortcut will be available as Quick Action:

- Edit the newly added Kaleidoscope Compare shortcut. Bring up the contextual menu and select Edit.
- From the menu, select View>Show Shortcut Details
- On the right side of the window, ensure the checkbox Use as Quick Action is selected.
- Also make sure that Finder below is selected.

4
Switch to Finder, select a few files and bring up the contextual menu. Select Quick Actions > Kaleidoscope Compare. Enjoy!

### Actions

Currently, Kaleidoscope provides three actions to the Shortcuts app:

#### Compare Files

This will show the input file(s) passed to the action in Kaleidoscope. Accepts one or more files.

By default, repeated calls will be shown in the same Kaleidoscope window, Use the Open a New Window option to trigger opening a new window. There is also an option to send the content to a specific document by specifying a Document Title. If a document with that title doesn't exist, it will be created.

Note that Open in New Window takes precedence. When checked, a new window will always be created, even if a document with a specified name already exists.

#### Compare Text

Works exactly like Compare Files, but accepts text as input.

#### Compare Folders

This compares a list of files in a Folder Comparison. You may optionally specify a Folder Name, to name the folder being compared in Kaleidoscope.

The remaining options Open in New Window and Document Title work the same way as in the actions above.

A use case for this action is to combine it with the Extract Archive action to compare the contents of archives like zip. See the Kaleidoscope Blog for more on that topic, including a sample workflow.

### Feedback

Tell us about your needs, so we can improve these actions over time. Use Help > Send Feedback… from the menu to get in touch.

## Git (Command Line) Integration

To integrate directly with Git, set up Kaleidoscope as a Git diff and merge tool, either as the default tool or as one of the available tools.

Some Git apps will need this configuration as a prerequisite for integrating with Kaleidoscope, others (like Tower) will work without prior setup.

### Installation

Make Kaleidoscope your default diff and merge tool by following these steps:

1
First install the ksdiff command line tool
2
Make Kaleidoscope Git's default diff and merge tool

#### Manual Installation

If you can't or don't want to use of the automatic installation options, follow these steps for manual configuration. Show more…

1

Open your git configuration file. By default this is a file called `.gitconfig` in your user directory.

2

At the end of the file, insert the following content:

[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
trustExitCode = true
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
3

To make Kaleidoscope the default diff tool, ensure this one line in the `[diff]` section. You need to add the section:

[diff]
tool = Kaleidoscope
4

Similar to above, ensure this content exists to make Kaleidoscope the default tool for merging conflicts:

[merge]
tool = Kaleidoscope

### Usage Examples

Compare the current working copy against the latest commited version:

git difftool

Compare two arbitrary branches:

git difftool [branch 1 name] [branch 2 name]

Merge conflicts of the current working copy:

git mergetool

git difftool takes the same arguments as git diff, see the man page for more information. To learn how Kaleidoscope's Git integration works, or for instructions on how to manually edit your .gitconfig to add Kaleidoscope integration, see the Git Integration topic in Kaleidoscope Help.

## Xcode Debugger Integration

Integrate Kaleidoscope directly with the Xcode command line debugger. Use commands `ksdiff` and `kspo` to compare debug output in Kaleidoscope.

!

### Update Available

An improved version of the integration is available. Please update.

### Installation

To make Kaleidoscope available from lldb, follow these steps:

1
First install the ksdiff command line tool
2
Configure to make the `ksdiff` and `kspo` commands available in lldb. Commands are available, the include has been added to ~/.lldbinit Update the Integration.
3
When Xcode is already running, either restart the app, or type the following in lldb:
command source ~/.lldbinit

### Usage

#### ksdiff

The ksdiff command in the debugger will send the result of any debugger command to Kaleidoscope. Use it repeatedly to compare debugger output.

Example: Compare the register state at various times:

ksdiff register read

#### kspo

The kspo command is like the built-in po, but automatically converts certain types into images for easier comparison in Kaleidoscope: CGImageRef, CIImage, UIView, UIWindow, UIImage, NSWindow, NSView, NSImage and NSBitmapImageRep.

Example: compare the description of two array objects:

kspo myArray1
kspo myArray2

Example: compare two UIImage objects:

kspo [UIImage imageNamed:@"image1"]
kspo [UIImage imageNamed:@"image2"]

Example: visually compare two views:

kspo view1
kspo view2

Example: instead of above, compare two view hierarchies by dumping their recursive descriptions:

kspo view1.recursiveDescription
kspo view2.recursiveDescription

## Xcode XCTest Integration

Kaleidoscope can parse results of XCTest failures and show them in a much more useful way. Check out the post on the Kaleidoscope blog to get started.

## Python Debugger Integration

Integrate Kaleidoscope directly with the `python` command line debugger.

### Installation

To make Kaleidoscope available from `pdb`, follow these steps:

1
First install the ksdiff command line tool
2
Configure to make the `ksdiff` command available in pdb. The Python `ksdiff` Command is available, the import has been added to ~/.pdbrc

### Help

ksdiff - pipe values to Kaleidoscope for inspection and diffing uses pprint.pformat() for non-string values Usage: ksdiff Examples: ksdiff myContentA ksdiff myContentB ksdiff myContentA, myContentB ksdiff myContentA, myContentB, label="GroupA"

### Usage Examples

Print the current state of the script environment

ksdiff dict(os.environ)

Print the current callstack

import traceback
ksdiff traceback.format_stack()

## JetBrains IDEs - AppCode, IntelliJ, PhpStorm and PyCharm

Kaleidoscope is supported by the current versions of AppCode, IntelliJ IDEA, PhpStorm, PyCharm and more.

1
First install the ksdiff command line tool
2
Make Kaleidoscope default diff and merge tool Kaleidoscope is enabled as diff and/or merge tool.

Quit and restart your JetBrains IDE for the automatic configuration to take effect.

These are the preferences settings for manual configuration:

Path to executable (both diff and merge tool):

/usr/local/bin/ksdiff

Parameters (diff tool):

--no-stdin %1 %2 %3

Parameters (merge tool):

--no-stdin --merge --output %4 --base %3 %1 %2

Turn on `Trust process exit code`

## Android Studio IDE integration

1
First install the ksdiff command line tool
2
Make Kaleidoscope default diff and merge tool Kaleidoscope is enabled as diff and/or merge tool.
3
Quit and restart Android Studio for the automatic configuration to take effect

These are the preferences settings for manual configuration:

Path to executable (both diff and merge tool):

/usr/local/bin/ksdiff

Parameters (diff tool):

--no-stdin %1 %2 %3

Parameters (merge tool):

--no-stdin --merge --output %4 --base %3 %1 %2

Turn on `Trust process exit code`

## Safari Developer Tools

Kaleidoscope Developer Tools (Dev Tools) for Safari is a Safari extension to help you develop web pages and web apps. The extension needs to be enabled in Safari.

### Installation

Kaleidoscope makes the Extension available automatically in Safari, so there is not need to install anything.

### Enable in Safari

1
Open Safari
2
From the menu, select Safari > Settings…, then select Extensions in the toolbar.
3
In the list of extensions, find Kaleidoscope Dev Tool and turn on its checkbox.
4
Confirm by clicking `Turn On` in the alert that immediately follows.

### Configure Toolbar Button

If you turn on Kaleidoscope Dev Tools, its toolbar button will automatically be added to the Safari toolbar. Customize the toolbar in Safari to suit your needs.

### Usage

Kaleidoscope Dev Tools offers 4 distinct pieces of functionality:

| #### ksdiff Page Source Triggered through the Kaleidoscope toolbar button in Safari, this action will send the whole source of the currently displayed page to Kaleidoscope. After making changes, reload the page and trigger again to see the comparison. This is useful when developing sites or apps and the results of your edits in HTML or JavaScript are not entirely trivial.
| #### ksdiff Element HTML Accessed via the context menu on a page selection, this action will send the enclosing HTML tag to Kaleidoscope. Again, use multiple times to compare elements. #### ksdiff Element CSS Similar to the above, this will send all style information of the current selection to Kaleidoscope.
| #### ksdiff JavaScript function A ksdiff function is added to the Console of the Web Inspector. Pass any text into it to send to Kaleidoscope. This allows inspecting and comparing of complex JavaScript objects or other elements.

### Note

Some security related web sites (i.e. banking) may refuse to work with the Kaleidoscope Developer Tools extension enabled. As Safari does not offer a way to blacklist extensions from certain websites, so you need to manually disable the extension from Safari > Settings > Extensions when visiting such a site.

## VSCode Editor & Git Integration

Kaleidoscope for Visual Studio Code (VSCode) helps you work with changes and merges inside the VSCode app.

It offers various functionalities, available through a toolbar button and several action and contextual menus:

### Installation

Kaleidoscope for VSCode needs to be installed via the Visual Studio Code Marketplace by Microsoft. The Marketplace can be accessed from within VSCode.

1
First install the ksdiff command line tool
2
To use Kaleidoscope with Git from within VSCode, make Kaleidoscope one of Git's diff and merge tools
3
Ensure Visual Studio Code is installed on your Mac
4
Open the Extension Page on the Marketplace
5
Click the Install button on that page and follow further instructions

### Settings

No configuration is necessary to use the extension. Check out the available settings in VSCode via the menu `Code > Preferences > Settings…`. Inside Settings, disclose the `Extensions` entry, then select `Kaleidoscope` from the list.

### Usage

#### Open with Kaleidoscope

This allows sending entire files to Kaleidoscope for comparison. Use multiple times to compare.

#### Compare with Kaleidoscope

Send selected text in any editor to Kaleidoscope. Use multiple times to compare.

#### Show Changes (Kaleidoscope)

Available from various places in the Source Control area, this will open Kaleidoscope via git difftool, showing source control changes in all selected files in one changeset window.

#### Start Merge (Kaleidoscope)

Available from the Source Control area in case of a conflict, this will open Kaleidoscope via git mergetool for a single file, allowing you to use Kaleidoscope for merging of conflicts.

## Versions Subversion Client

Kaleidoscope is supported by Versions 1.0.8 and later.

1
Select Kaleidoscope as your comparison tool in Versions' Preferences
Quit and restart Versions if Kaleidoscope doesn't appear right away.

## Subversion Command Line Integration

To integrate Kaleidoscope directly with the Subversion command line integration, set it up as your default SVN diff or merge tool, or use it without making it the default. To make Kaleidoscope your default diff or merge tool, follow these steps:

1
First install the ksdiff command line tool
2
Open the ~/.subversion/config file
3
Add and save the following:
[helpers]
diff-cmd = ksdiff
merge-tool-cmd = ksdiff
Usage example:
svn diff /path/to/working_copy

To diff images from SVN, you need to add the --force parameter:

svn diff --force img/icon.png

To use Kaleidoscope with Subversion without making it your default diff tool:

1
Install the ksdiff command line tool
Usage example:
svn diff --diff-cmd=ksdiff /path/to/working_copy

If an svn update command results in merge conflicts, it prompts you as to the action you wish to take. The l (lowercase l, for launch) option will launch Kaleidoscope to complete the merge.

## Jujutsu Command Line Integration

Jujutsu is a powerful version control system for software projects sharing similarities with Git. To integrate Kaleidoscope directly with the `jj` command line tool, set it up as your default diff and merge editor. Follow these steps:

1
First install the ksdiff command line tool
2
Open the `jj` config.toml configuration file
3
Add and save the following:
[ui]
diff-formatter = "ksdiff"
merge-editor = "ksdiff"
[merge-tools.ksdiff]
diff-invocation-mode = "file-by-file"
diff-args = ["--partial-changeset", "$left", "$right"]
merge-args = ["--merge", "--output", "$output", "--base", "$base", "$left", "$right"]

### Usage

#### Viewing Changes

The following command will show the changes in your working copy in a Kaleidoscope Changeset:

`jj diff`

To see changes between two arbitrary change IDs in your repository:

`jj interdiff --from changeID1 --to changeID2`

#### Resolving Conflicts

If there is an unresolved conflict, the following command will open a merge document in Kaleidoscope, helping you to resolve using both sides and the base:

`jj resolve`

If there are conflicts in multiple files, jj will go through them one-by-one.

## Mercurial Command Line Integration

To integrate Kaleidoscope directly with Mercurial, you'll need the extdiff extension. This extension is included in Mercurial by default, but it will need to be activated.

To set everything up, follow these instructions:

1
First install the ksdiff command line tool
2
Open the ~/.hgrc file
3
Add and save the following:
[extensions]
hgext.extdiff =
[extdiff]
cmd.ksdiff = /usr/local/bin/ksdiff
opts.ksdiff = --changeset --wait --filelist
[ui]
merge = Kaleidoscope
[merge-tools]
Kaleidoscope.executable = /usr/local/bin/ksdiff
Kaleidoscope.args = --merge --output $output --base $base -- $local $other
Usage example:
hg ksdiff
hg merge

## Raycast Commands

The Kaleidoscope Extension for Raycast allows you to compare or open content from Raycast in Kaleidoscope.

There are basic commands to to Compare Files and Compare Clipboards from the Raycast Clipboard History. And there are Git related commands like Open Changeset to open the changeset for a given commit identifier (hash) or Open Git File History to show the history of all commits for a single file.

### Installation

The Kaleidoscope Extension needs to be installed via the Raycast Store.

1
Locate the Kaleidoscope extension in the Raycast Store
2
Select Install Extension on the Extension page

### Usage

#### Compare Clipboards

Compare the two latest entries in the Raycast Clipboard History. The content of those clipboards can be text, images, or files. Note: Only content of the same type can be compared, text with text, or image with image.

#### Compare Files (or Folders)

Compare Files (or Folders) selected in Finder, if Finder is frontmost, or up to six Files (or Folders) from the Raycast Clipboard History. Note: A File cannot be compared with a Folder.

#### Open Changeset

Show Changeset for a Git Commit. Commit Identifier (aka Commit Hash) is taken from Clipboard, or manually provided. Note: Kaleidoscope needs to know the repository for this to work.

#### Open Git File History

Show the History of Git commits for the File selected in Finder, if Finder is frontmost, or the File found on the Clipboard.

## Alfred Workflow Integration

Use the Diff last 2 Clipboards action to quickly compare the last two pieces of text you copied to the clipboard using the Alfred Clipboard History.

The Diff Files in File Buffer action lets you run a comparison of files you previously added to the Alfred File Buffer.

### Installation

To integrate Kaleidoscope directly with Alfred, you need to install our Alfred workflow.

!

### Update Available

An improved version of the integration is available. Please update.

To set everything up, follow these instructions:

1
Ensure Alfred is installed and you have a Powerpack License.
2
Configure to make the Workflow available and open it in Alfred. To remove, locate Kaleidoscope Alfred Integration in the Workflows list, select it, and click the minus (-) button on the bottom. Update the Integration.

### Settings

Two hotkeys for immediate actions that can be defined. To set them, open the workflow in Alfred Preferences > Workflows > Kaleidoscope Integration.

- File Buffer: Triggering that hotkey will immediately send the Alfred File Buffer contents to Kaleidoscope for comparison.
- Finder Selection: This hotkey will send the currently selected files in Finder to Kaleidoscope for comparison.

### Usage

Compare the last two entries in the Alfred Clipboard History:

- Bring up the Alfred search window
- Type `ksclip`

Compare any number of files (of the same kind), using the Alfred File Buffer:

1. Bring up the Alfred search window
2. Find the first file to compare
3. Type ⌥↑ (option + cursor up)
4. Repeat 2. and 3. for additional files
5. Type ⌥→ (option + cursor right)
6. Type `kscomp`

Read more on the topic in the Kaleidoscope Blog.

## BBEdit Script & Services

The Diff Unsaved Changes in Kaleidoscope script helps you to compare changes you made to a file in BBEdit, before saving it.

The Compare Text in Kaleidoscope service allows to compare any text selections using Kaleidoscope.

### Installation

To integrate Kaleidoscope directly with BBEdit, follow these instructions:

!

### Update Available

An improved version of the integration is available. Please update.

1
First install the ksdiff command line tool
2
Ensure BBEdit is installed and has run before.
3
Configure to make the script available in BBEdit. This will remove the script from BBEdit. Update the script to the latest version.

### Usage

Compare the last saved version of a file with the current editor state:

- Open a file in BBEdit
- Make some changes to the document, without saving.
- Select `Diff Unsaved Changes in Kaleidoscope` from the script () menu.

### Services Support

Being a good Mac app, BBEdit also supports the use of services, text services to be precise. That way, you can send any selected text into Kaleidoscope, either via the context menu or the BBEdit menu.

To compare any two selections of text using Kaleidoscope:

- Open a file in BBEdit
- Select a first piece of text you want to compare.
- Choose `Compare Text in Kaleidoscope` from the bottom of the context menu. It can either be found in a submenu called `Services`, or directly in the context menu.
- Kaleidoscope will activate and open a document. Go back to BBEdit.
- Select a second block of text.
- Again, choose `Compare Text in Kaleidoscope` from the context menu.
- Kaleidoscope will activate and show the comparison of those two text blocks.

#### Note

In case the context menu does not offer `Compare Text in Kaleidoscope`, head to the Services section to learn how to configure it correctly.

Read more on BBEdit integration in the Kaleidoscope Blog.

## P4 Command Line Integration

To integrate Kaleidoscope directly with the Perforce Command Line Client, you can use the p4 command line tool. To set up the command line tool, follow these instructions:

1
First install the ksdiff command line tool
2
Open your shell profile
3
Add and save the following:
export P4DIFF=/usr/local/bin/ksdiff
export P4MERGE=/usr/local/bin/ksdiff
Usage example:
p4 resolve
p4 diff

## P4V GUI Integration

To integrate Kaleidoscope directly with Perforce, you can use the P4V GUI application. To set up P4V, follow these instructions:

1
First install the ksdiff command line tool
2
Open P4V
3
Open preferences
4
Select Diff
Set Location to:
/usr/local/bin/ksdiff
Set Arguments to:
%1 %2
5
Select Merge
Set Location to:
/usr/local/bin/ksdiff
Set Arguments to:
--no-stdin --merge --output %r --base %b -- %1 %2

## Bazaar Command Line Integration

To integrate Kaleidoscope directly with Bazaar, set it up as your default diff and merge tool, or configure it without making it the default. To use it as an external merge tool, you'll need qbzr and Bazaar 2.4 or later. To make Kaleidoscope your default diff and merge tool, follow these steps:

1
First install the ksdiff command line tool
2
Make Kaleidoscope Bazaar's default diff and merge tool
Usage example:
bzr diff

To set up Kaleidoscope as a diff/merge tool without making it the default:

1
First install the ksdiff command line tool
2
Make Kaleidoscope one of Bazaar's diff/merge tools
Diff usage example:
bzr ksdiff
Merge usage example:
bzr qconflicts

## TextMate Subversion Integration

To use Kaleidoscope as TextMate's Subversion diff tool, follow these instructions:

1
First install the ksdiff command line tool
2
Open TextMate and go to TextMate's preferences
3
Go to the “Variables” tab (TextMate 1 users, go to “Advanced” tab, and then to “Shell Variables”)
4
Create a new variable by pressing the plus button
5
Enter the following variable name:
TM_SVN_DIFF_CMD
6
Enter the following value:
/usr/local/bin/ksdiff
Usage example:

Select a changed file in the file shelf. Press ⌃⇧A (control + shift + A) to pop up the Subversion Bundle commands. Select "Diff with Working Copy". Your changes should now be displayed in Kaleidoscope.

## TextMate Mercurial Integration

To use Kaleidoscope as TextMate's Mercurial diff tool, follow these instructions:

1
First install the ksdiff command line tool
2
Open TextMate and go to TextMate's preferences
3
Go to the “Variables” tab (TextMate 1 users, go to “Advanced” tab, and then to “Shell Variables”)
4
Create a new variable by pressing the plus button
5
Enter the following variable name:
TM_HG_EXT_DIFF
6
Enter the following value:
/usr/local/bin/ksdiff
7
Create a new variable by pressing the plus button
8
Enter the following variable name:
TM_HG
9
Enter the following value:
/usr/local/bin/hg
Usage example:

Select a changed file in the file shelf. Press ⌃⇧M (control + shift + M) to pop up the Mercurial Bundle commands. Select "Diff with Working Copy". Your changes should now be displayed in Kaleidoscope.