The user interface of the dtache package just got an upgrade. The package now features the dtache-consult.el, which provides integration of dtache with the excellent consult package. The command dtache-consult-session is provided, and its intended to be used as replacement of dtache-open-session for consult users.

The reason to favor the dtache-consult-session is to leverage consult's ability to support multiple candidate sources. In the dtache context this means that by default all session candidates are shown, but by using the narrow feature of consult we can change the source to only display a subset.

Consult sources

The different sources that dtache-consult-session are using is defined in the dtache-consult-sources variable.

(defcustom dtache-consult-sources
  "Sources used by `dtache-consult-session'.

See `consult-multi' for a description of the source values."
  :type '(repeat symbol)
  :group 'dtache)

The dtache-consult--source-session contains all sessions, while all the other (may) contain a subset of the sessions. Here is a short description of each of the sources and how to activate them.

Variable Type Key
dtache-consult–source-active-session Active sessions a
dtache-consult–source-inactive-sessio Inactive sessions i
dtache-consult–source-success-session Successful sessions s
dtache-consult–source-failure-session Failed sessions f
dtache-consult–source-local-session Local host sessions l
dtache-consult–source-remote-session Remote host sessions r
dtache-consult–source-current-session Current host sessions c

To be able to narrow the candidate sessions based on different criterion is a great feature, especially once the list of sessions starts to grow long. The dtache-consult sources can be grouped into three different types. Here are examples of the different sources.

State sources

The first type of source to narrow by is state. A session can either be in an active or inactive state.

Status sources

The second type of source to narrow by is status. A session’s status can either be success or failure.

Host sources

And lastly the type of source to narrow by is host. For this type there are three different criterion we can filter by. Firstly sessions that are running on our localhost. Secondly filters that are running on a remote host. Thirdly, sessions that are running on current host, which is useful when working on a remote host.

Click on this link to navigate to the project and check the README on how to get started with dtache-consult.