 (require 'ar-vsetq)
 (require 'ar-csetq)
+(require 'seq)
 
 (use-package shell-pop
   :ensure t

    (ar/vsetq eshell-error-if-no-glob t)
    (ar/vsetq eshell-glob-case-insensitive t)
    (ar/vsetq eshell-list-files-after-cd nil)

    (defun ar/eshell-counsel-history ()
      (interactive)

             (args (progn
                     (set-text-properties 0 (length input) nil input)
                     (split-string input))))
        (if (and (equal "cd" (nth 0 args))
                 (not (seq-find (lambda (item)
                                  (string-prefix-p "/ssh:" item))
                                args)))
            (apply orig-fun (list (format "cd %s"
                                          (expand-file-name (concat default-directory
                                                                    (nth 1 args))))))
