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

Use tmux shell-command #1964

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Use tmux shell-command #1964

wants to merge 5 commits into from

Conversation

jablko
Copy link
Contributor

@jablko jablko commented Apr 9, 2020

Since Tmux.new(shell) (:bash, :zsh, :fish) are just indexes to Shell.send(shell),

fzf/test/test_go.rb

Lines 89 to 90 in 15e2952

def initialize(shell = :bash)
@win = go(%W[new-window -d -P -F #I #{Shell.send(shell)}]).first

  • fzf/test/test_go.rb

    Lines 55 to 63 in 15e2952

    def bash
    @bash ||=
    begin
    bashrc = '/tmp/fzf.bash'
    File.open(bashrc, 'w') do |f|
    f.puts(ERB.new(TEMPLATE).result(binding))
    end
    "bash --rcfile #{bashrc}"
  • fzf/test/test_go.rb

    Lines 67 to 76 in 15e2952

    def zsh
    @zsh ||=
    begin
    zdotdir = '/tmp/fzf-zsh'
    FileUtils.rm_rf(zdotdir)
    FileUtils.mkdir_p(zdotdir)
    File.open("#{zdotdir}/.zshrc", 'w') do |f|
    f.puts(ERB.new(TEMPLATE).result(binding))
    end
    "ZDOTDIR=#{zdotdir} zsh"
  • fzf/test/test_go.rb

    Lines 80 to 81 in 15e2952

    def fish
    UNSETS.map { |v| v + '= ' }.join + 'fish'

what do you think about simply passing the command to Tmux.new instead?
https://github.com/jablko/fzf/blob/21afe1c09bd7e6775503195a1aed00eb3b40e0fc/test/test_go.rb#L56-L57

This was originally part of #1900

@junegunn
Copy link
Owner

junegunn commented Apr 9, 2020

Thanks but why don't we open a separate pull request for Rubocop changes you made first? They are not related to what you're proposing here. That way, it would be easier to discuss different concerns (#1900 #1962 #1964).

@jablko
Copy link
Contributor Author

jablko commented Apr 9, 2020

👍 Thank you for reviewing these changes. I've opened a PR for just the RuboCop changes: #1967

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

Successfully merging this pull request may close these issues.

None yet

2 participants