sesh 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36c6a8e5a1802215f8320befafd49f5db4434be4
4
- data.tar.gz: c6af33a578de3319671b4393b5608c66c3af5ed2
3
+ metadata.gz: 778297769aa09cf17f59f199a3d60d39fc05e6f9
4
+ data.tar.gz: ccb02fbe907590287018b237d5df85d66b36828b
5
5
  SHA512:
6
- metadata.gz: adfaf130ee276f65aa942f2d388836ff4137196218e5e66c7878b492d00f51c4ee9171f82e368e762fb46af25ece9a8ee16434b29965c2b052fb88ad651db9b0
7
- data.tar.gz: 390b4d6a19e0895ff3057b0ac2f6527d42a5f88b2675b9cb3a89f4533135502fe8b26e2775d93e34515bc780ea686ae731fb32c42061f583230e251b227e9686
6
+ metadata.gz: 8c2a2200deaf1ed97de80198ce860137fcb6dde1f87ffec819666e75dbb7546e65b0cda7e1b43d577ef246c4f31987d9ba059a39000c7eeaaf2da8ec11188ab0
7
+ data.tar.gz: d1d3d10d95a64720f2eb665ee689473078703ad8e7c436bcfba864cf07c2b380d5ad6e77395513856afbecda17d73a2126b95341cea1cb271f07ae604d34fd3c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sesh (0.3.5)
4
+ sesh (0.3.6)
5
5
  awesome_print (~> 1.6)
6
6
  colorize (~> 0.7.7)
7
7
  deep_merge (~> 1.0)
data/Session.vim CHANGED
@@ -324,10 +324,10 @@ badd +32 sesh.gemspec
324
324
  badd +18 exe/return_to_sesh.applescript
325
325
  badd +1 \'/Users/smit1625/Sites/sesh/exe/return_to_sesh.applescript\'
326
326
  badd +2 exe/return_to_sesh
327
- badd +0 exe/sesh
327
+ badd +3 exe/sesh
328
328
  argglobal
329
329
  silent! argdel *
330
- edit exe/sesh
330
+ edit lib/sesh/version.rb
331
331
  set splitbelow splitright
332
332
  wincmd _ | wincmd |
333
333
  split
@@ -337,7 +337,10 @@ vsplit
337
337
  1wincmd h
338
338
  wincmd _ | wincmd |
339
339
  split
340
- 1wincmd k
340
+ wincmd _ | wincmd |
341
+ split
342
+ 2wincmd k
343
+ wincmd w
341
344
  wincmd w
342
345
  wincmd w
343
346
  wincmd _ | wincmd |
@@ -353,18 +356,20 @@ set nosplitbelow
353
356
  set nosplitright
354
357
  wincmd t
355
358
  set winheight=1 winwidth=1
356
- exe '1resize ' . ((&lines * 19 + 31) / 62)
359
+ exe '1resize ' . ((&lines * 15 + 31) / 62)
357
360
  exe 'vert 1resize ' . ((&columns * 102 + 136) / 272)
358
- exe '2resize ' . ((&lines * 20 + 31) / 62)
361
+ exe '2resize ' . ((&lines * 14 + 31) / 62)
359
362
  exe 'vert 2resize ' . ((&columns * 102 + 136) / 272)
360
- exe '3resize ' . ((&lines * 20 + 31) / 62)
361
- exe 'vert 3resize ' . ((&columns * 169 + 136) / 272)
362
- exe '4resize ' . ((&lines * 19 + 31) / 62)
363
+ exe '3resize ' . ((&lines * 14 + 31) / 62)
364
+ exe 'vert 3resize ' . ((&columns * 102 + 136) / 272)
365
+ exe '4resize ' . ((&lines * 22 + 31) / 62)
363
366
  exe 'vert 4resize ' . ((&columns * 169 + 136) / 272)
364
- exe '5resize ' . ((&lines * 19 + 31) / 62)
365
- exe 'vert 5resize ' . ((&columns * 101 + 136) / 272)
366
- exe '6resize ' . ((&lines * 19 + 31) / 62)
367
- exe 'vert 6resize ' . ((&columns * 170 + 136) / 272)
367
+ exe '5resize ' . ((&lines * 22 + 31) / 62)
368
+ exe 'vert 5resize ' . ((&columns * 169 + 136) / 272)
369
+ exe '6resize ' . ((&lines * 14 + 31) / 62)
370
+ exe 'vert 6resize ' . ((&columns * 101 + 136) / 272)
371
+ exe '7resize ' . ((&lines * 14 + 31) / 62)
372
+ exe 'vert 7resize ' . ((&columns * 170 + 136) / 272)
368
373
  argglobal
369
374
  setlocal fdm=manual
370
375
  setlocal fde=0
@@ -375,7 +380,7 @@ setlocal fml=1
375
380
  setlocal fdn=20
376
381
  setlocal fen
377
382
  silent! normal! zE
378
- let s:l = 1 - ((0 * winheight(0) + 9) / 19)
383
+ let s:l = 1 - ((0 * winheight(0) + 7) / 15)
379
384
  if s:l < 1 | let s:l = 1 | endif
380
385
  exe s:l
381
386
  normal! zt
@@ -383,6 +388,24 @@ normal! zt
383
388
  normal! 0
384
389
  wincmd w
385
390
  argglobal
391
+ edit exe/sesh
392
+ setlocal fdm=manual
393
+ setlocal fde=0
394
+ setlocal fmr={{{,}}}
395
+ setlocal fdi=#
396
+ setlocal fdl=0
397
+ setlocal fml=1
398
+ setlocal fdn=20
399
+ setlocal fen
400
+ silent! normal! zE
401
+ let s:l = 3 - ((1 * winheight(0) + 7) / 14)
402
+ if s:l < 1 | let s:l = 1 | endif
403
+ exe s:l
404
+ normal! zt
405
+ 3
406
+ normal! 015|
407
+ wincmd w
408
+ argglobal
386
409
  edit lib/sesh/tmux_control.rb
387
410
  setlocal fdm=manual
388
411
  setlocal fde=0
@@ -393,12 +416,12 @@ setlocal fml=1
393
416
  setlocal fdn=20
394
417
  setlocal fen
395
418
  silent! normal! zE
396
- let s:l = 185 - ((9 * winheight(0) + 10) / 20)
419
+ let s:l = 192 - ((12 * winheight(0) + 7) / 14)
397
420
  if s:l < 1 | let s:l = 1 | endif
398
421
  exe s:l
399
422
  normal! zt
400
- 185
401
- normal! 09|
423
+ 192
424
+ normal! 033|
402
425
  wincmd w
403
426
  argglobal
404
427
  edit lib/sesh/ssh_control.rb
@@ -411,7 +434,7 @@ setlocal fml=1
411
434
  setlocal fdn=20
412
435
  setlocal fen
413
436
  silent! normal! zE
414
- let s:l = 38 - ((1 * winheight(0) + 10) / 20)
437
+ let s:l = 38 - ((1 * winheight(0) + 11) / 22)
415
438
  if s:l < 1 | let s:l = 1 | endif
416
439
  exe s:l
417
440
  normal! zt
@@ -429,12 +452,12 @@ setlocal fml=1
429
452
  setlocal fdn=20
430
453
  setlocal fen
431
454
  silent! normal! zE
432
- let s:l = 10 - ((9 * winheight(0) + 9) / 19)
455
+ let s:l = 41 - ((15 * winheight(0) + 11) / 22)
433
456
  if s:l < 1 | let s:l = 1 | endif
434
457
  exe s:l
435
458
  normal! zt
436
- 10
437
- normal! 044|
459
+ 41
460
+ normal! 058|
438
461
  wincmd w
439
462
  argglobal
440
463
  edit lib/sesh.rb
@@ -447,7 +470,7 @@ setlocal fml=1
447
470
  setlocal fdn=20
448
471
  setlocal fen
449
472
  silent! normal! zE
450
- let s:l = 45 - ((8 * winheight(0) + 9) / 19)
473
+ let s:l = 45 - ((6 * winheight(0) + 7) / 14)
451
474
  if s:l < 1 | let s:l = 1 | endif
452
475
  exe s:l
453
476
  normal! zt
@@ -465,26 +488,27 @@ setlocal fml=1
465
488
  setlocal fdn=20
466
489
  setlocal fen
467
490
  silent! normal! zE
468
- let s:l = 94 - ((18 * winheight(0) + 9) / 19)
491
+ let s:l = 94 - ((13 * winheight(0) + 7) / 14)
469
492
  if s:l < 1 | let s:l = 1 | endif
470
493
  exe s:l
471
494
  normal! zt
472
495
  94
473
496
  normal! 032|
474
497
  wincmd w
475
- 2wincmd w
476
- exe '1resize ' . ((&lines * 19 + 31) / 62)
498
+ exe '1resize ' . ((&lines * 15 + 31) / 62)
477
499
  exe 'vert 1resize ' . ((&columns * 102 + 136) / 272)
478
- exe '2resize ' . ((&lines * 20 + 31) / 62)
500
+ exe '2resize ' . ((&lines * 14 + 31) / 62)
479
501
  exe 'vert 2resize ' . ((&columns * 102 + 136) / 272)
480
- exe '3resize ' . ((&lines * 20 + 31) / 62)
481
- exe 'vert 3resize ' . ((&columns * 169 + 136) / 272)
482
- exe '4resize ' . ((&lines * 19 + 31) / 62)
502
+ exe '3resize ' . ((&lines * 14 + 31) / 62)
503
+ exe 'vert 3resize ' . ((&columns * 102 + 136) / 272)
504
+ exe '4resize ' . ((&lines * 22 + 31) / 62)
483
505
  exe 'vert 4resize ' . ((&columns * 169 + 136) / 272)
484
- exe '5resize ' . ((&lines * 19 + 31) / 62)
485
- exe 'vert 5resize ' . ((&columns * 101 + 136) / 272)
486
- exe '6resize ' . ((&lines * 19 + 31) / 62)
487
- exe 'vert 6resize ' . ((&columns * 170 + 136) / 272)
506
+ exe '5resize ' . ((&lines * 22 + 31) / 62)
507
+ exe 'vert 5resize ' . ((&columns * 169 + 136) / 272)
508
+ exe '6resize ' . ((&lines * 14 + 31) / 62)
509
+ exe 'vert 6resize ' . ((&columns * 101 + 136) / 272)
510
+ exe '7resize ' . ((&lines * 14 + 31) / 62)
511
+ exe 'vert 7resize ' . ((&columns * 170 + 136) / 272)
488
512
  tabnext 1
489
513
  if exists('s:wipebuf')
490
514
  silent exe 'bwipe ' . s:wipebuf
@@ -27,6 +27,18 @@ module Sesh
27
27
  if OS.windows? then 'notepad.exe'
28
28
  else o = `echo $EDITOR`.strip; o = 'vim' unless o.length > 0; o end
29
29
  end
30
+ def self.infer_tmux_project
31
+ tmux_session_pid = `echo $TMUX | cut -d , -f 2`.strip
32
+ return if tmux_session_pid.length == 0
33
+ tmux_process_line =
34
+ `ps aux | grep tmux | grep #{tmux_session_pid}`.strip.lines.first
35
+ return if tmux_process_line.nil?
36
+ tmux_process_line.split('-s ')[-1].split(' -n')[0]
37
+ end
38
+ def self.infer_tmux_pane
39
+ return if ( o = `echo $TMUX_PANE`.strip ).nil?; o[1..-1].to_i end
40
+ def self.infer_tmux_location; {
41
+ project: infer_tmux_project, pane: infer_tmux_pane } end
30
42
 
31
43
  module OS
32
44
  def OS.windows?
@@ -183,10 +183,16 @@ module Sesh
183
183
  if options[:and_return]
184
184
  options[:command] = "return_to_sesh &; #{options[:command]}"
185
185
  end
186
+ inferred_location = Inferences.infer_tmux_location
186
187
  if options[:pane].nil?
187
- interrupt_and_send_command_to_project! options[:command]
188
+ if inferred_location[:project] == @project then system options[:command]
189
+ else interrupt_and_send_command_to_project! options[:command] end
188
190
  else
189
- interrupt_and_send_command_to_pane! options[:pane], options[:command]
191
+ if inferred_location == { project: @project, pane: options[:pane] }
192
+ system options[:command]
193
+ else
194
+ interrupt_and_send_command_to_pane! options[:pane], options[:command]
195
+ end
190
196
  end
191
197
  end
192
198
 
data/lib/sesh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sesh
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sesh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - MacKinley Smith