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

Show session name in lualine? #14

Closed
toddknutson opened this issue Oct 8, 2022 · 2 comments
Closed

Show session name in lualine? #14

toddknutson opened this issue Oct 8, 2022 · 2 comments

Comments

@toddknutson
Copy link

Is there a way to show the current session name in a lualine section?

It seems like I would need to create a custom lualine component that returns the Possession session name as a string. It seems like I could get the session name from this function, but I'm not sure how to do that exactly. Any help would be appreciated! Thanks for a great plugin!

@jedrzejboczar
Copy link
Owner

Hi, the following should do the job:

local function session_name()
    return require('possession.session').session_name or ''
end

@toddknutson
Copy link
Author

Thanks so much @jedrzejboczar! This works perfect!!

For anyone else coming across this, I simply copied the suggested function (above) to my lualine config and then referenced the function name within the lualine setup. For example:

lualine.setup {
  sections = { lualine_a = { session_name } }
}

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

No branches or pull requests

2 participants