Skip to content

Commit

Permalink
Add session.working_directory method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexherbo2 committed Sep 9, 2021
1 parent 3476ad6 commit 32fff4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/kakoune/cli.cr
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ module Kakoune::CLI

when :list
data = Session.all.flat_map do |session|
working_directory = session.get("%sh{pwd}")[0]
working_directory = session.working_directory

[{ session: session.name, client: nil, buffer_name: nil, working_directory: working_directory }] +

Expand Down
4 changes: 4 additions & 0 deletions src/kakoune/session.cr
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,8 @@ class Kakoune::Session
def buffer(name)
Buffer.new(self, name)
end

def working_directory
Path[get("%sh{pwd}")[0]]
end
end

0 comments on commit 32fff4d

Please sign in to comment.